note 46584 added to function.implode
| From: | paul dot php at burney dot ws | Date: | Sat, 16 Oct 2004 03:35:40 +0000 |
| Subject: | note 46584 added to function.implode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78636@lists.php.net to get a copy of this message | ||
If the array you are imploding is empty, implode returns {null}, not an empty string. This can be a
concern if you are imploding a dynamically generated array to place in a database. If you get a
null and the database field is set to NOT NULL, you get a contstraint violation. This has happened
to me with prepared queries in which the system trys to figure out how to send the data to the
database.
----
Manual Page -- http://www.php.net/manual/en/function.implode.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46584
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46584&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46584&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46584&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46584&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46584&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46584&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46584&report=yes
Search -- http://master.php.net/manage/user-notes.php