RE: [PHP] Sorting Help

From: Date: Wed, 11 Apr 2012 17:11:40 +0000
Subject: RE: [PHP] Sorting Help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-317530@lists.php.net to get a copy of this message
-----Original Message----- From: Floyd Resler [mailto:fresler@adex-intl.com] Sent: Wednesday, April 11, 2012 11:26 AM To: PHP Subject: [PHP] 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);

« previous php.general (#317530) next »