I have the following array which contains 10k records or so
Array
(
[0] => Array
(
[0] => 111
[1] => 14/02/2020
[2] => 36
)
[6] => Array
(
[0] => 222
[1] => 29/12/2019
[2] => 1
)
[7] => Array
(
[0] => 222
[1] => 27/11/2019
[2] => 3
)
[8] => Array
(
[0] => 333
[1] => 12/09/2019
[2] => 4
)
The result I want would be to count how many times each value at [0] occurs along with the sum of what's in [2] to show something like the following
Array
(
[0] => Array
(
[0] => 111
[1] => 1
[2] => 36
)
[1] => Array
(
[0] => 222
[1] => 2
[2] => 4
)
[2] => Array
(
[0] => 333
[1] => 1
[2] => 4
)
I have tried a few things but the code got too unwieldy so I have now come back to a blank piece of paper. I tried array_count_values of a multi dimensional array? which is close as it gives me the count of what is at [0] but seems a bit overkill and I don't get the sum of [2]