My PHP code:
Code: Select all
<?php
$a = array(array(array('fifth',5),array('sixth',15),array('fourth',1)),array(array('second',5),array('third',15),array('first',1)));
function cmp($a, $b)
{
if ($a[1]==$b[1])
return 0;
return ($a[1] < $b[1]) ? -1 : 1;
}
usort($a, "cmp");
var_dump($a);
?>