Need a little help here with summing up arrays inside a multi dimensional php array
Eg Multidimensional array
Array
(
[0] => Array
(
[0] => 30
[1] => 5
[2] => 6
[3] => 7
[4] => 8
[5] => 9
[6] => 2
[7] => 5
)
[1] => Array
(
[0] => 50
[1] => 4
[2] => 8
[3] => 4
[4] => 4
[5] => 6
[6] => 9
[7] => 2
)
)
I want to have a result array that will be holding sum of both these arrays like this
Array
(
[0] => 80
[1] => 9
[2] => 14
[3] => 11
[4] => 12
[5] => 15
[6] => 11
[7] => 7
)
Any help will be greatly appreciated
Thanks!
This should work for arrays like the one of your example (
$arr
is an array like the one in your example, I haven't defined it here for simplicity's sake):