a ver si esto te sirve:
Código PHP:
$autor[0]["nombre"] = "Luis";
$autor[0]["mensajes"] = 34;
$autor[1]["nombre"] = "Pedro";
$autor[1]["mensajes"] = 2;
$autor[2]["nombre"] = "juan";
$autor[2]["mensajes"] = 10;
function ordenar($marray){
foreach ($marray as $fila){
$s1[] = $fila["mensajes"];
}
array_multisort($s1, SORT_REGULAR, SORT_DESC, $marray);
return $marray;
}
$autor = ordenar($autor);