note 21649 deleted from function.fgets by sniper
| From: | sniper@php.net | Date: | Sat, 08 Feb 2003 20:09:48 +0000 |
| Subject: | note 21649 deleted from function.fgets by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43661@lists.php.net to get a copy of this message | ||
In response to carlomitchell@hotmail.com saying the following takes a long time,
while(!feof($fp))
$buffer[] = chop(fgets($fp,filesize($filename)));
Well, if you were to get the file length outside the loop, it would only have to ask once, making it
quicker.
$fsize = filesize($filename);
while(!feof($fp))
$buffer[] = chop(fgets($fp,$fsize));