1$inventory = array(
2
3 array("type"=>"fruit", "price"=>3.50),
4 array("type"=>"milk", "price"=>2.90),
5 array("type"=>"pork", "price"=>5.43),
6
7);
8$price = array_column($inventory, 'price');
9array_multisort($price, SORT_DESC, $inventory);
1 $weight = [
2 'Pete' => 75,
3 'Benjamin' => 89,
4 'Jonathan' => 101
5 ];
6 ksort($weight);
1 function cmp($a, $b)
2 {
3 return strcmp($a->display_name, $b->display_name);
4 }
5
6 usort($blogusers, "cmp");
7
8 foreach ($blogusers as $bloguser)
9 {
10 ...