I have this array:
$arr['success'][] = array( "id" => $out[$c_id], "nick" => $out[$c_nick], "inv" => $out[$c_inv] ); I need to sort the output from "inv" in ascending order, how can this be implemented?
$out[$c_id], "nick" => $...">
I have this array:
$arr['success'][] = array( "id" => $out[$c_id], "nick" => $out[$c_nick], "inv" => $out[$c_inv] ); I need to sort the output from "inv" in ascending order, how can this be implemented?
function cmp ($ALeft, $Aright) { if ($ALeft['inv'] < $Aright['inv']) return -1; if ($ALeft['inv'] == $Aright['inv']) return 0; return 1; } usort($arr['success'], 'cmp'); Source: https://ru.stackoverflow.com/questions/574168/
All Articles
$arr['success']sort ascending the key value ofinv? - Alex