Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #4094 > unrolled thread
| Started by | Mike <mpearl1@gmail.com> |
|---|---|
| First post | 2011-12-19 12:09 -0800 |
| Last post | 2011-12-19 12:09 -0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.php
implode() order? Mike <mpearl1@gmail.com> - 2011-12-19 12:09 -0800
| From | Mike <mpearl1@gmail.com> |
|---|---|
| Date | 2011-12-19 12:09 -0800 |
| Subject | implode() order? |
| Message-ID | <31336254.768.1324325354197.JavaMail.geo-discussion-forums@prmw6> |
How can I define the order that an array implodes? See code sample below:
<?php
$toImplode = Array(
1 => "Second",
0 => "First",
2 => "Third"
);
$finalString = implode(" - ", $toImplode);
echo "<p>" . $finalString . "</p>";
/* Results as "Second - First - Third"
* But I need it to be "First - Second - Third"
*/
?>
Back to top | Article view | comp.lang.php
csiph-web