note 37432 deleted from function.fgets by sniper
| From: | sniper@php.net | Date: | Sat, 03 Jan 2004 02:46:04 +0000 |
| Subject: | note 37432 deleted from function.fgets by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62824@lists.php.net to get a copy of this message | ||
Note Submitter:
----
In response to carlomitchell at hotmail dot com's code:
while(!feof($fp))
$buffer[] = chop(fgets($fp,filesize($filename)));
Its running the filesize() command on every iteration of the while loop. Which is a bit silly. This
does the same thing, only much quicker:
$filesize = filesize($filename);
while(!feof($fp))
$buffer[] = chop(fgets($fp,$filesize));