|
Posted by Erwin Moller on 03/26/07 12:05
Davide wrote:
> On 24 Mar, 09:39, "Davide" <davide.papa...@gmail.com> wrote:
>> sorry.. this is the correct one:
>>
>> $pizza = "/var/www/foo.txt";
>> $lines = file('/var/www/foo.txt');
>> foreach ($lines as $line_num => $line) {
>> htmlspecialchars($line) . "<br />\n";
>> $pieces = explode(" ", htmlspecialchars($line) . "<br />\n");
>> echo $pieces[0]; // piece1
>> echo $pieces[1]; // piece2
>> }
>>
>> it echoes only the first line of the file
>>
>> pippo pluto
>
> Ok.. I solved...
> It was the space in <br />
>
> $pizza = "/var/www/foo.txt";
> $lines = file('/var/www/foo.txt');
> foreach ($lines as $line_num => $line) {
> htmlspecialchars($line) . "<br>\n";
> $pieces = explode(" ", htmlspecialchars($line) . "<br>\n");
> echo $pieces[0]; // piece1
> echo $pieces[1]; // piece2
> }
Well, you seemed to solved it all by yourself. :-)
Now have a nice pizza. :P
Regards,
Erwin Moller
[Back to original message]
|