I'm trying to sort an array like following

myArray[1][firstname] = "Joe";
myArray[1][lastname] = "Smith";
myArray[1][company] = "Bullock";
myArray[1][email] = "[EMAIL PROTECTED]";
myArray[2][firstname] = "Jim";
myArray[2][lastname] = "Cords";
myArray[2][company] = "Jamen";
myArray[2][email] = "[EMAIL PROTECTED]";

by the company name. How can I do it?

I found the solution on php.net
(http://www.php.net/manual/en/function.array-multisort.php) but it sorts
only the first row:

foreach ($myArray as $val) {
        $sortarray[] = $val['nafn'];
                echo $val['stadur'];
array_multisort($myArray, $sortarray);

Thanks in advance!


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to