Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1820969.7NaK4W3vae@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Tue, 20 Dec 2011 02:55:49 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: implode() order? Newsgroups: comp.lang.php References: <23705179.475.1324325630088.JavaMail.geo-discussion-forums@yqgn9> <10925269.424.1324326983924.JavaMail.geo-discussion-forums@yqnd19> Followup-To: comp.lang.php MIME-Version: 1.0 Lines: 35 NNTP-Posting-Date: 20 Dec 2011 02:55:49 CET NNTP-Posting-Host: 194777ea.newsspool4.arcor-online.net X-Trace: DXC=lncWdaIXA9M[kmHKHnaEnM4IUKWCAe57HgkMGGfI X-Complaints-To: usenet-abuse@arcor.de Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4103 Mike wrote: > Thanks... suppose the keys are not in a sortable order, like this: > > $toImplode = Array( > "second" = "Second", > "fourth" = "Fourth", > "third" = "Third", > "first" = "First" > ); This is not PHP code. > Or would I need to simply: > > echo $toImplode["first"] . $toImplode["second"]; // etc. No, aside from u(k)sort() you can use a loop to build a new array: $a = array(); foreach (array('first', 'second', 'third', 'fourth') as $key) { $a[] = $toImplode[$key]; } echo implode(',', $a); PointedEars -- Prototype.js was written by people who don't know javascript for people who don't know javascript. People who don't know javascript are not the best source of advice on designing systems that use javascript. -- Richard Cornford, cljs,