note 108791 added to function.implode
| From: | michael dot janapin at gmail dot com | Date: | Thu, 24 May 2012 23:13:20 +0000 |
| Subject: | note 108791 added to function.implode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188212@lists.php.net to get a copy of this message | ||
I think some suggestions mentioned here in imploding an associative array for SQL operations might
need some tweaking.
implode("', '", $array) leaves the first element with a missing open quote and
the last element with a missing close quote.
i.e.,
$some_array = array(1,2,3);
$neat_list = implode('", "', $some_array);
echo $neatlist;
// RESULTS TO:
// 1", "2", "3
I think the glue is inserted just between the elements, thus the first open quote and the last open
quote are missing.
----
Server IP: 69.147.83.197
Probable Submitter: 119.93.223.166
----
Manual Page -- http://www.php.net/manual/en/function.implode.php
Edit -- https://master.php.net/note/edit/108791
Del: integrated -- https://master.php.net/note/delete/108791/integrated
Del: useless -- https://master.php.net/note/delete/108791/useless
Del: bad code -- https://master.php.net/note/delete/108791/bad+code
Del: spam -- https://master.php.net/note/delete/108791/spam
Del: non-english -- https://master.php.net/note/delete/108791/non-english
Del: in docs -- https://master.php.net/note/delete/108791/in+docs
Del: other reasons-- https://master.php.net/note/delete/108791
Reject -- https://master.php.net/note/reject/108791
Search -- https://master.php.net/manage/user-notes.php