$inventory = array(
array("fruit"=>"orange", "price"=>3),
array("fruit"=>"kiwi", "price"=>2),
array("fruit"=>"apple", "price"=>3),
array("fruit"=>"apple", "price"=>3),
array("fruit"=>"apple", "price"=>3),
array("fruit"=>"orange", "price"=>3),
array("fruit"=>"banana", "price"=>10),
array("fruit"=>"banana", "price"=>10),
);
// 我想要做的是遍历这个数组并为每个唯一键'fruit'添加所有'prices',然后对它们进行排序
// 前任。我希望实现的输出将是这样的数组:
$sum_array = array("banana"=>"20", "apple"=>"9", "orange"=>"6", "kiwi"=>"2");