<?php $yourArray = [ ['item1' => 80], ['item2' => 25], ['item3' => 85], ]; function cmp($a, $b) { $a = reset($a); // get the first array elements $b = reset($b); // for comparison. if ($a == $b) { return 0; } return ($a < $b) ? -1 : 1; } usort($yourArray, "cmp"); print_r($yourArray);
You have javascript disabled. You will not be able to edit any code.