Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #22023 > unrolled thread
| Started by | Greg <greg@alicie.com> |
|---|---|
| First post | 2018-05-03 14:38 +0200 |
| Last post | 2018-05-04 18:47 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to it.comp.www.php
T_ENCAPSED_AND_WHITESPACE Greg <greg@alicie.com> - 2018-05-03 14:38 +0200
Re: T_ENCAPSED_AND_WHITESPACE fmigliori <fmigliori@gmail.com> - 2018-05-03 08:14 -0700
Re: T_ENCAPSED_AND_WHITESPACE Alessandro Pellizzari <shuriken@amiran.it> - 2018-05-03 17:35 +0100
Re: T_ENCAPSED_AND_WHITESPACE Greg <greg@alicie.com> - 2018-05-04 18:47 +0200
| From | Greg <greg@alicie.com> |
|---|---|
| Date | 2018-05-03 14:38 +0200 |
| Subject | T_ENCAPSED_AND_WHITESPACE |
| Message-ID | <pcevri$aql$1@solani.org> |
Come mai sulla seconda fwrite mi da errore? $file_a = fopen($file, "a"); fwrite($file_a, "$day $time $bbb $BG $pagina \r\n"); fclose($file_a); $fint = fopen($files_b, "a"); fwrite($fint, "$day $time $_SERVER['HTTP_USER_AGENT'] $pagina \r\n"); fclose($fint); ----------- syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) -- Greg
[toc] | [next] | [standalone]
| From | fmigliori <fmigliori@gmail.com> |
|---|---|
| Date | 2018-05-03 08:14 -0700 |
| Message-ID | <7d9f214d-5112-4d12-89ba-3990750e6c24@googlegroups.com> |
| In reply to | #22023 |
Prova: fwrite($fint, "$day $time " . $_SERVER['HTTP_USER_AGENT'] . " $pagina \r\n");
[toc] | [prev] | [next] | [standalone]
| From | Alessandro Pellizzari <shuriken@amiran.it> |
|---|---|
| Date | 2018-05-03 17:35 +0100 |
| Message-ID | <fl0s1kFhlg1U1@mid.individual.net> |
| In reply to | #22023 |
On 03/05/2018 13:38, Greg wrote: > fwrite($fint, "$day $time $_SERVER['HTTP_USER_AGENT'] $pagina \r\n"); Non contare mai sull'espansione implicita delle stringhe. Usa sempre viroglette singole. Quando devi concatenare più di 2-3 variabili, usa sprintf() Bye.
[toc] | [prev] | [next] | [standalone]
| From | Greg <greg@alicie.com> |
|---|---|
| Date | 2018-05-04 18:47 +0200 |
| Message-ID | <pci2r7$dee$1@solani.org> |
| In reply to | #22025 |
Il 03/05/18 18:35:00 Alessandro Pellizzari ha scritto: > On 03/05/2018 13:38, Greg wrote: > >> fwrite($fint, "$day $time $_SERVER['HTTP_USER_AGENT'] $pagina \r\n"); > > Non contare mai sull'espansione implicita delle stringhe. > > Usa sempre viroglette singole. > > Quando devi concatenare più di 2-3 variabili, usa sprintf() > > Bye. Merci a tutti -- Greg
[toc] | [prev] | [standalone]
Back to top | Article view | it.comp.www.php
csiph-web