note 55536 deleted from function.feof by didou

From: Date: Wed, 03 Jan 2007 01:45:05 +0000
Subject: note 55536 deleted from function.feof by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121216@lists.php.net to get a copy of this message
Note Submitter: info at derlange dot tk ---- NOTE! if your file is empty and you make the feof()-check, it will return true the first time you call it. example: $handle=fopen("file","r"); while(!feof($handle)) { $line=fgets($handle); } $line is now an empty string ( "" ) you have to check the size of your file before, like this sample code: if (filesize("file")>0) { while( !feof($handle) ) { $zeile=fgets($handle); } }

« previous php.notes (#121216) next »