note 79757 added to function.implode
| From: | oskar dot blom at gmail dot com | Date: | Tue, 11 Dec 2007 16:04:57 +0000 |
| Subject: | note 79757 added to function.implode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-133368@lists.php.net to get a copy of this message | ||
Another "english" implode...
<?php
$nums = array('1st', '2nd', '3rd', '4th', '5th');
print implode(" and ", array(implode(", ", array_slice($nums, 0, -1)),
$nums[count($nums) - 1]));
?>
outputs:
1st, 2nd, 3rd, 4th and 5th
----
Server IP: 129.16.214.50
Probable Submitter: 83.227.240.56
----
Manual Page -- http://www.php.net/manual/en/function.implode.php
Edit -- https://master.php.net/note/edit/79757
Del: integrated -- https://master.php.net/note/delete/79757/integrated
Del: useless -- https://master.php.net/note/delete/79757/useless
Del: bad code -- https://master.php.net/note/delete/79757/bad+code
Del: spam -- https://master.php.net/note/delete/79757/spam
Del: non-english -- https://master.php.net/note/delete/79757/non-english
Del: in docs -- https://master.php.net/note/delete/79757/in+docs
Del: other reasons-- https://master.php.net/note/delete/79757
Reject -- https://master.php.net/note/reject/79757
Search -- https://master.php.net/manage/user-notes.php