Given this array:
$inventory = array( array(\"type\"=>\"fruit\", \"price\"=>3.50), array(\"type\"=>\"milk\", \"price\"=>2.90), array(\"
I use uasort like this
uasort
'joe', 'age' => 11 ], [ 'username' => 'rakoto', 'age' => 21 ], [ 'username' => 'rabe', 'age' => 17 ], [ 'username' => 'fy', 'age' => 19 ], ]; uasort($users, function ($item, $compare) { return $item['username'] >= $compare['username']; }); var_dump($users);