RE: [PHP] file reading and regex
| From: | Jay Blanchard | Date: | Tue, 03 Jun 2003 14:08:01 +0000 |
| Subject: | RE: [PHP] file reading and regex | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-149968@lists.php.net to get a copy of this message | ||
[snip]
<?php
$URLbase =
"http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GMS-5/jpg/vis/4km/";
if (!($fp = fopen($URLbase, "r")))
{
echo "<p style=color:white>Could not open the url</p>";
exit;
}
$contents = fread($fp, 1000000);
fclose($fp);
?>
[/snip]
Was that really a line break after $URLbase = ? (Probably not, but just
checking) ...
Try adding a 'b' to your fopen ...
fopen($URLbase, "rb")
... in the event that you're dealing with a Windows platform.
HTH!
Jay