here is my array
[Computers] => Array
(
[0] => Array
(
[product_id] => 78
[price] => 999.99
[quantity] => 2
)
[1] => Array
(
[product_id] => 70
[price] => 49.99
[quantity] => 6
)
)
[Scanners] => Array
(
[0] => Array
(
[product_id] => 65
[price] => 99.99
[quantity] => 7
)
[1] => Array
(
[product_id] => 70
[price] => 149.99
[quantity] => 5
)
[2] => Array
(
[product_id] => 70
[price] => 10.99
[quantity] => 1
)
)
I was looking for a way to total up the values of the outer arrays based on the inner arrays
so for example the Computers array has two products and i need to get the totals based on quantity. So for example (999.99 *2) + (49.99 * 6) = 2299.92 for the computer array and so on…
Here is a solution which is untested, but I don´t see why it shouldn´t work