3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function build_sorter($key) { return function ($a, $b) use ($key) { if ($a[$key] == $b[$key]) { return 0; } return ($a[$key] < $b[$key]) ? -1 : 1; }; } $array = array('123' => array('1'=> 2, 'balance_USD' => -1), '12' => array('1'=> 2, 'balance_USD' => 12),); usort($array, $this->build_sorter('balance_USD')); var_dump($array);