I have an array structured like this:
Array
(
[0] => Array
(
[0] => cmi.interactions.0.result
[1] => 1
[2] => 0
)
[1] => Array
(
[0] => cmi.interactions.0.result
[1] => 0
[2] => 1
)
[2] => Array
(
[0] => cmi.interactions.0.result
[1] => 0
[2] => 1
)
[3] => Array
(
[0] => cmi.interactions.1.result
[1] => 1
[2] => 0
)
[4] => Array
(
[0] => cmi.interactions.1.result
[1] => 1
[2] => 0
)
[5] => Array
(
[0] => cmi.interactions.1.result
[1] => 1
[2] => 0
)
)
What I would like is the following:
Array
(
[0] => Array
(
[0] => cmi.interactions.0.result
[1] => 1
[2] => 2
)
[1] => Array
(
[0] => cmi.interactions.1.result
[1] => 3
[2] => 0
)
)
Basically I want to know how to find where the first value in each subarray match and add the second and third value accordingly?