Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $inventory = array(
- array("type"=>"fruit", "price"=>3.50),
- array("type"=>"milk", "price"=>2.90),
- array("type"=>"pork", "price"=>5.43),
- );
- $price = array();
- foreach ($inventory as $key => $row)
- {
- $price[$key] = $row['price'];
- }
- array_multisort($price, SORT_DESC, $inventory);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement