note 102526 deleted from function.fgetcsv by cmb
| From: | cmb@php.net | Date: | Sun, 16 Jun 2019 08:12:05 +0000 |
| Subject: | note 102526 deleted from function.fgetcsv by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211269@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
NOTE: i think the example in this page should be changed. I think the following line should be added
to just inside the while loop:
if( $data === true ) die('PAY ATTENTION DUMMY');
The reasoning for this, is if the user happens to take out the seemingly "extra" brackets
around the "$data" part, they will get a while bunch of rows where all they get is the
value true instead of an array. This way, if the user borrows the code but then later on removes the
seemingly "extra" brackets, they have something keeping them safe from themselves at
least.
I say this because this just happened to some poorly designed code in a system I manage, that as a
result caused a whole bunch of blank records to be imported into a database.