note 78863 added to function.implode
| From: | anajilly at osu1 dot php dot net | Date: | Wed, 31 Oct 2007 07:23:37 +0000 |
| Subject: | note 78863 added to function.implode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131850@lists.php.net to get a copy of this message | ||
When implode() is passed an array with a single element or
with no elements, it does exactly what you would expect.
<?php
$a = array(); // passed an array with zero elements...
implode(';', $a); // implode returns an empty string: ''
$a[] = 'n'; // passed an array with one element
implode(';', $a); // returns the single element value with no $glue used: 'n'
?>
----
Server IP: 209.41.74.194
Probable Submitter: 71.84.116.217
----
Manual Page -- http://www.php.net/manual/en/function.implode.php
Edit -- https://master.php.net/note/edit/78863
Del: integrated -- https://master.php.net/note/delete/78863/integrated
Del: useless -- https://master.php.net/note/delete/78863/useless
Del: bad code -- https://master.php.net/note/delete/78863/bad+code
Del: spam -- https://master.php.net/note/delete/78863/spam
Del: non-english -- https://master.php.net/note/delete/78863/non-english
Del: in docs -- https://master.php.net/note/delete/78863/in+docs
Del: other reasons-- https://master.php.net/note/delete/78863
Reject -- https://master.php.net/note/reject/78863
Search -- https://master.php.net/manage/user-notes.php