Posted by Erwin Moller on 01/29/07 14:07
craig.keightley@gmail.com wrote:
> i have the following array:
>
> Array
> (
> [0] => Array
> (
> [0] => Leamore Windows Ltd
> [1] => 553398833511417
> [2] => 20
> )
>
> [1] => Array
> (
> [0] => HRPC
> [1] => 920589205210538
> [2] => 1
> )
>
> [2] => Array
> (
> [0] => Leamore Windows Ltd
> [1] => 553398833511417
> [2] => 2
> )
>
> )
>
>
> is it possible to group the items in the array and order by name to
> output the following:
>
> Array
> (
> [0] => Array
> (
> [0] => HRPC
> [1] => 920589205210538
>
> [2] => 1
> )
>
> [1] => Array
> (
> [0] => Leamore Windows Ltd
>
> [1] => 553398833511417
> [2] => 22
> )
>
>
> )
Hi,
Have a look at usort()
http://nl2.php.net/manual/en/function.usort.php
With usort you can define your own sortingrules.
Regards,
Erwin Moller
[Back to original message]
|