fopen timeout
| From: | Erich Kolb | Date: | Fri, 19 Jul 2002 19:54:59 +0000 |
| Subject: | fopen timeout | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2273@lists.php.net to get a copy of this message | ||
I am opening a series of documents over the internet using fopen inside of a
loop. Is there an easy way to set a timeout so that if the file is not
available, it will move to the next one?
while ($row = mysql_fetch_array($sql)) {
$channel_title = $row["ChannelTitle"];
$channel_link = $row["ChannelLink"];
$channel_dataurl = $row["ChannelDataURL"];
$fpread = fopen($channel_dataurl, 'r');
if(!$fpread){
echo "Error opening datafile: <b>$channel_dataurl</b>\n";
echo "$errstr ($errno)<br>\n";
}
}
...