note 48954 rejected from function.feof by didou

From: Date: Wed, 03 Jan 2007 01:45:39 +0000
Subject: note 48954 rejected from function.feof by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121217@lists.php.net to get a copy of this message
Note Submitter: bruno dot moreira at brturbo dot com ---- 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.

« previous php.notes (#121217) next »