I have an array that looks like this:
Array
(
[0] => Array
(
[amount] => 60.00
[store_id] => 1
)
[1] => Array
(
[amount] => 40.00
[store_id] => 1
)
[2] => Array
(
[amount] => 10.00
[store_id] => 2
)
)
What would be a good method to reduce the array to a similar array that totals the 'amount' related to a store_id.
For Instance I'd like to get this:
Array
(
[0] => Array
(
[amount] => 100.00
[store_id] => 1
)
[2] => Array
(
[amount] => 10.00
[store_id] => 2
)
)