note 27393 deleted from function.fgets by sniper
| From: | sniper@php.net | Date: | Sat, 03 Jan 2004 02:46:39 +0000 |
| Subject: | note 27393 deleted from function.fgets by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62833@lists.php.net to get a copy of this message | ||
Note Submitter: dirk@nospam.de
----
Never use the while loop in the manner of the examples given above.
If you have an error opening your file "!eof($fd)" will always evalute to true resulting
in an infinite loop.
Something like "while ($fd && !eof($fd)) { }" avoids this problem.