I need to count the same values in multidimensional array and remove the duplicates.
My array:
$r = [
['a','b'],
['a','b'],
['c','d'],
['c','d'],
['c','d'],
['e','f'],
];
Need to output:
[0] => Array
(
[0] => a
[1] => b
[1] => 2 // Result
)
[1] => Array
(
[0] => c
[1] => d
[1] => 3 // Result
)
[2] => Array
(
[0] => e
[1] => f
[1] => 1 // Result
)
I will be very grateful for your help.