sorting a multidimension array?
Posted: Wed Aug 22, 2007 8:12 pm
Strings are the strings i want associated with the perc's i want the results to be like this
String 3: 80%
String 1: 12%
String 2: 8%
how can I do this?
String 3: 80%
String 1: 12%
String 2: 8%
how can I do this?
Code: Select all
$ar = array(
array($strings[0], $strings[1], $strings[2], $strings[3], $strings[4], $strings[5], $strings[6], $strings[7]),
array($percs[0], $percs[1], $percs[2], $percs[3], $percs[4], $percs[5], $percs[6], $percs[7])
);
array_multisort($ar[0], SORT_DESC, SORT_STRING,
$ar[1], SORT_NUMERIC, SORT_DESC);