Problem with file() function
| From: | Hayan Al Mamoun | Date: | Tue, 19 Feb 2002 10:58:27 +0000 |
| Subject: | Problem with file() function | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-17049@lists.php.net to get a copy of this message | ||
Dear sirs, Please help with the follows:
When I'm trying to execute this code:
--------------------------------
$fcontents = file ('http://localhost/');
while (list ($line_num, $line) = each ($fcontents)) {
echo "<b>Line $line_num:</b>; " . htmlspecialchars ($line) .
"<br>\n";
}
--------------------------------
it runs perfectly, but when I try to change to:
--------------------------------
$fcontents = file ('http://www.php.net/');
while (list ($line_num, $line) = each ($fcontents)) {
echo "<b>Line $line_num:</b>; " . htmlspecialchars ($line) .
"<br>\n";
}
--------------------------------
it dosn't work, Can you tell why please...
Best Regards
Hayan