note 67957 rejected from function.feof by didou
| From: | didou@php.net | Date: | Wed, 03 Jan 2007 01:43:38 +0000 |
| Subject: | note 67957 rejected from function.feof by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121214@lists.php.net to get a copy of this message | ||
Note Submitter: jorge dot mendes at constante dot pt
----
feof() not reliable
I used feof() in a context of retrieving a CSV file into a database.
I had the following code:
while(!feof($file_handler)){
$row = fgets($file_handler);
(...)
}
I was processing several files, and in some of them, the last row was duplicated, so I assume that
feof() is not reliable.
That's how I solved the problem:
while($row = fgets($file_handler)){
(...)
}