Попробуйте использовать uasort ():
<?
function cmp($a, $b)
{
return ($b['count'] + $b['changes']) - ($a['count'] + $a['changes']);
}
$arr = array(
'John' => array('count' => 10, 'changes' => 1),
'Martin' => array('count' => 5, 'changes' => 5),
'Bob' => array('count' => 15, 'changes' => 5),
);
uasort($arr, "cmp");
print_r($arr);
?>
печать:
Array
(
[Bob] => Array
(
[count] => 15
[changes] => 5
)
[John] => Array
(
[count] => 10
[changes] => 1
)
[Martin] => Array
(
[count] => 5
[changes] => 5
)
)