Re: sorting multiple-dimensional arrays

From: Date: Sun, 18 Aug 2002 22:01:39 +0000
Subject: Re: sorting multiple-dimensional arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113162@lists.php.net to get a copy of this message
Thanks Rasmus. On Sunday 18 August 2002 02:37 pm, you wrote: > usort(), uasort() or uksort(). uasort() has a nice little example in the > user comment. > > On Sun, 18 Aug 2002, Evan Nemerson wrote: > > I have an array that looks like > > > > $array = Array( > > Array($var1, $var2, $var3), > > Array($var1, $var2, $var3), > > Array($var1, $var2, $var3) > > ); > > > > I want to sort the arrays within $array by $var3 (although if it helps i > > can easily change that to $var1). $var1 and $var2 are strings, $var3 is a > > number (in form of ([0-9]{3}\.[0-9]) ) > > > > I know i could put something together that would make a new, > > single-dimensional array that looks like Array(var3, var3, var3...), sort > > that, then use that as a reference point, but that's a really sloppy > > approach, and I'm thinking probably not the best way. > > > > I have a feeling someone is just going to reply with only > > "php.net/somefunction" in the body of their message, and I'll feel > > stupid, but oh well. I can't find anything in the man. > > > > Any input would be appreciated. > > > > > > -Evan > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#113162) next »