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


Groups > comp.lang.php > #4094

implode() order?

From Mike <mpearl1@gmail.com>
Newsgroups comp.lang.php
Subject implode() order?
Date 2011-12-19 12:09 -0800
Organization http://groups.google.com
Message-ID <31336254.768.1324325354197.JavaMail.geo-discussion-forums@prmw6> (permalink)

Show all headers | View raw


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 comp.lang.php | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web