Sorting assiciative arrays...
Posted: Mon Aug 13, 2007 10:53 pm
Alright, well, I have an associative array which assigns arrays of 4 values to strings (see the example below):
Up to now, I've been using ksort on the big array and it sorted it by the "value1", "value2", etc., alphabetically. Now, however, I want it sorted numerically by the 4th value of each smaller array inside the big array (the -10, 65, and 10 in the above example).
How would I go about doing this?
Thanks in advance for any help
Code: Select all
Array ( [value1] => Array ( [0] => 65 [1] => 2 [2] => 75 [3] => -10 ) [value2] => Array ( [0] => 65 [1] => 2 [2] => 0 [3] => 65 ) [value3] => Array ( [0] => 15 [1] => 2 [2] => 5 [3] => 10 ) )How would I go about doing this?
Thanks in advance for any help