Posted by gbbulldog on 12/17/02 11:56
Balaskas Evaggelos wrote:
> Hi,
>
> does anyone know how i can sort a multi-dimensional array
> by a specific field ?
>
> for example i want to sort arr[m][n] where n=2,
> but i need the data of every array to follow that order.
>
> example array:
> arr[0][0]
> arr[0][1]
> arr[0][2]
> arr[0][3]
> arr[0][4]
> arr[0][5]
>
> arr[1][0]
> arr[1][1]
> arr[1][2]
> arr[1][3]
> arr[1][4]
> arr[1][5]
You can use the array_multisort() function to do this. More info and a
number of examples of useage can be found at :
http://uk.php.net/manual/en/function.array-multisort.php
[Back to original message]
|