note 47497 added to function.fgetcsv
| From: | php-general at lists dot php dot net | Date: | Thu, 18 Nov 2004 06:47:52 +0000 |
| Subject: | note 47497 added to function.fgetcsv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-80688@lists.php.net to get a copy of this message | ||
example 1 above goes into an infinte loop if the file name is bad because fgetcsv return a false
result not identical to false but equl to false
to fix this use != instead of !== in the test as shown below it will still work correctly for the
case when the file exists.
while (($data = fgetcsv($handle, 1000, ",")) != FALSE) {
----
Manual Page -- http://www.php.net/manual/en/function.fgetcsv.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47497
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47497&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47497&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47497&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47497&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47497&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47497&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47497&report=yes
Search -- http://master.php.net/manage/user-notes.php