Re: Sorting multidimensional arrays..
| From: | Tim Ward | Date: | Thu, 30 Jan 2003 22:27:10 +0000 |
| Subject: | Re: Sorting multidimensional arrays.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133703@lists.php.net to get a copy of this message | ||
if 'EXTENSION' is unique then you can make life
a lot easier by making that the key of the root array
(this is a heirarchy of arrays).
Tim Ward
http://www.chessish.com
mailto:timward@chessish.com
----- Original Message -----
From: Chad Day <cday@atpco.com>
To: php general <php-general@lists.php.net>
Sent: Thursday, January 30, 2003 7:29 PM
Subject: [PHP] Sorting multidimensional arrays..
> I'm struggling with array_multisort, was hoping someone could give me some
> help.
>
> I have a multidim array, such as:
>
> $myarray[0][FIRSTNAME] = JOE
> $myarray[1][FIRSTNAME] = TIM
> $myarray[2][FIRSTNAME] = BOB
>
> $myarray[0][LASTNAME] = SMITH
> $myarray[1][LASTNAME] = BROWN
> $myarray[2][LASTNAME] = JONES
>
> $myarray[0][EXTENSION] = 2000
> $myarray[1][EXTENSION] = 4000
> $myarray[2][EXTENSION] = 1000
>
> I was trying array_multisort($myarray[EXTENSION], SORT_NUMERIC,
SORT_DESC),
> but nothing seems to be happening to the array. If anyone has any clues
or
> can point me in the right direction, I would appreciate it.
>
> Thanks,
> Chad
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>