|
Posted by PigInACage on 03/28/07 11:09
On 26 Mar, 14:05, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spamyourself.com> wrote:
> 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
Yes! Just RTFM carefully :)
Hope it helps someone...
:P
[Back to original message]
|