note 17319 added to function.feof

From: Date: Tue, 04 Dec 2001 15:01:31 +0000
Subject: note 17319 added to function.feof
Groups: php.notes 
Request: Send a blank email to php-notes+get-21602@lists.php.net to get a copy of this message
If you use feof to walk through a file in a webpage, like this for instance: while(!feof($fd)) { // do things } it's arguably easier to use filesize instead: for ($i=0; $i<filesize($fd); $i++) { //do things } If you use feof and the file is not found, php will generate an endless list of errors. And you'll wonder why your webpage continues loading for so long... -- http://www.php.net/manual/en/function.feof.php http://master.php.net/manage/user-notes.php?action=edit+17319 http://master.php.net/manage/user-notes.php?action=delete+17319 http://master.php.net/manage/user-notes.php?action=reject+17319

« previous php.notes (#21602) next »