So, I have 2 arrays and I need to compare the arrays against each another and if the keys match I need to add up those values of those matching keys.
I'm little lost at how to accomplish this.
Here are my arrays:
// array 1
Array
(
[45] => Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 7
[5] => 7
[6] => 7
[7] => 7
)
[47] => Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 6
[5] => 6
[6] => 6
[7] => 6
)
[43] => Array
(
[0] => 4
[1] => 5
[2] => 4
[3] => 5
[4] => 8
[5] => 8
[6] => 8
[7] => 10
)
[8] => Array
(
[0] => 3
[1] => 4
[2] => 5
[3] => 6
[4] => 10
[5] => 10
[6] => 7
[7] => 8
)
)
//array 2
Array
(
[45] => Array
(
[0] => 9
[1] => 9
[2] => 9
[3] => 9
[4] => 6
[5] => 7
[6] => 7
[7] => 7
)
[47] => Array
(
[0] => 8
[1] => 8
[2] => 8
[3] => 8
[4] => 7
[5] => 7
[6] => 7
[7] => 7
)
[43] => Array
(
[0] => 7
[1] => 6
[2] => 9
[3] => 6
[4] => 7
[5] => 7
[6] => 7
[7] => 7
)
[8] => Array
(
[0] => 9
[1] => 9
[2] => 9
[3] => 9
[4] => 7
[5] => 7
[6] => 7
[7] => 7
)
)
as insight would really be appreciated... Thanks