1function sortByAge($a, $b) {
2 return $a['age'] > $b['age'];
3}
4$people=[
5 ["age"=>54,"first_name"=>"Bob","last_name"=>"Dillion"],
6 ["age"=>22,"first_name"=>"Sarah","last_name"=>"Harvard"],
7 ["age"=>31,"first_name"=>"Chuck","last_name"=>"Bartowski"]
8];
9
10usort($people, 'sortByAge'); //$people is now sorted by age (ascending)