Posted by Davide on 03/24/07 08:39
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
Navigation:
[Reply to this message]
|