Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4094 > unrolled thread

implode() order?

Started byMike <mpearl1@gmail.com>
First post2011-12-19 12:09 -0800
Last post2011-12-19 12:09 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.php


Contents

  implode() order? Mike <mpearl1@gmail.com> - 2011-12-19 12:09 -0800

#4094 — implode() order?

FromMike <mpearl1@gmail.com>
Date2011-12-19 12:09 -0800
Subjectimplode() 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"
 */
?>

[toc] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web