note 79757 deleted from function.implode by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 15:32:24 +0000 |
| Subject: | note 79757 deleted from function.implode by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133573@lists.php.net to get a copy of this message | ||
Note Submitter: oskar dot blom at gmail dot com
Reason: 1
----
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