0
I have the following associative array:
Array Actual:
Array
(
[0] => Array
(
[num] => 51
[totalparcial] => 2.50
)
[1] => Array
(
[num] => 51
[totalparcial] => 3.70
)
[2] => Array
(
[num] => 52
[totalparcial] => 5.00
)
[3] => Array
(
[num] => 52
[totalparcial] => 22.00
)
[4] => Array
(
[num] => 52
[totalparcial] => 14.00
)
)
How can I get information from the index that has the same value in [num]
, add the [totalparcial]
and create a new array with these new values?
In this example I would like the final result to be an array like this:
Array Desired:
Array
(
[0] => Array
(
[num] => 51
[totalparcial] => 6.20
)
[1] => Array
(
[num] => 52
[totalparcial] => 41.00
)
)
Thanks!
Generated the array exactly as I needed! Thanks!
– Léo