Re: Multi-Sort -- how to do this?

From: Date: Wed, 17 Jun 2009 23:27:03 +0000
Subject: Re: Multi-Sort -- how to do this?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-294192@lists.php.net to get a copy of this message
At 10:54 PM +0100 6/17/09, Ashley Sheridan wrote:
I'd probably go with some sort of custom bubble sorting function. Base the sorting on your $d array, and then update the other arrays as necessary. Should be OK if they all have the same index, like in your example. If you were using keys, could you maybe join all the arrays using some sort of serialisation, sort, then unserialise into the separate arrays? Thanks Ash
Ash: You missed the point. I could use the built-in sort (i.e., sort() ) and sort the $d array. However, I would like the indexes of the other arrays to match the new sort. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#294192) next »