note 18593 added to function.fopen
| From: | wootton_d at hotmail dot noSpam dot com | Date: | Mon, 28 Jan 2002 22:53:25 +0000 |
| Subject: | note 18593 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25941@lists.php.net to get a copy of this message | ||
Currently I'm grabbing a bunch of files named test1.sav, test2.sav ... testN.sav
if I do:
$archive_number = 1;
//Open each archive and display them. Works for files 1 to N.
while ($fp = @fopen "post/test$archive_number.sav","r")){
while (!feof ($fp)) {
$b = fgets($fp, 4096);
echo "<BR>$b";
}
$archive_number = archive_number + 1;
}
fclose($fp);
I still get warnings - when it hits
N+1 (ie the file doesn't exist.)
Is there anyway to suppress this error?
--
http://www.php.net/manual/en/function.fopen.php
http://master.php.net/manage/user-notes.php?action=edit+18593
http://master.php.net/manage/user-notes.php?action=delete+18593
http://master.php.net/manage/user-notes.php?action=reject+18593