RE: Sorting Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Floyd Resler [mailto:fresler@xxxxxxxxxxxxx] 
Sent: Wednesday, April 11, 2012 11:26 AM
To: PHP
Subject:  Sorting Help

I need to sort the following array:
{
	[Smith, Bob]=>array(137.5,125.5),
	[Jones, Robert]=>array(132.7,128.2)
}

The array needs to be sorted by the first number (i.e. 137.5) and then the
second in descending order.  I looked at array_multisort but couldn't figure
out how to make work for my needs.

Thanks!
Floyd



Here is what I did to your array

$test = array("Smith, Bob"=>array(137.5,125.5),"Jones
Robert"=>array(132.7,128.2));
asort($test);
print_r('<pre>');
print_r($test);






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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux