FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » implode() order?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
implode() order? [message #176297] Mon, 19 December 2011 20:09
Mike is currently offline  Mike
Messages: 18
Registered: December 2010
Karma: 0
Junior Member
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"
*/
?>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reading recommendation for PHP- OOP
Next Topic: implode() order?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 15:33:32 GMT 2024

Total time taken to generate the page: 0.02857 seconds