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$inventory = [
2 ['price' => 10.99, 'product' => 'foo 1'],
3 ['price' => 5.99, 'product' => 'foo 2'],
4 ['price' => 100, 'product' => 'foo 3'],
5
6];
7
8$price = array_column($inventory, 'price');
9
10array_multisort($price, SORT_DESC, $inventory);