note 48954 added to function.feof

From: Date: Wed, 12 Jan 2005 23:43:09 +0000
Subject: note 48954 added to function.feof
Groups: php.notes 
Request: Send a blank email to php-notes+get-83173@lists.php.net to get a copy of this message
Use it with many caution. If your php.ini don't stop the script when it enter a infinity loop. I don't think as good the use of feof with an while loop. See the example: $a=open("/etc/passwd"); while(!feof($a)){ echo fgets($a); } I used '/etc/passwd' because obviously the apache user isn't root, then cannot read '/etc/passwd'. If in future the feof return's some different that TRUE or FALSE, this can be used with good results. ---- Manual Page -- http://www.php.net/manual/en/function.feof.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48954 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48954&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48954&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48954&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48954&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48954&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48954&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48954&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83173) next »