I have this array
Array
(
[0] => Array
(
[status] => 15
[orario] => 10:00
)
[1] => Array
(
[status] => 15
[orario] => 11:00
)
[2] => Array
(
[status] => 15
[orario] => 09:00
)
[3] => Array
(
[status] => 12
[orario] => 09:00
)
[4] => Array
(
[status] => 12
[orario] => 09:00
)
[5] => Array
(
[status] => 12
[orario] => 10:00
)
)
So I want a new array where I have the count of similar status, in this case, status=12, I have 2 values with status 12 and orario = 09:00, 1 case with status=12 and orario = 10:00
Array
(
09:00 => 2
10:00 => 1
)
with array_column I have no filter
$stat_orario = array_column($the_array, 'status', 'orario');
print_r($stat_orario);
So I have the total result
Array
(
09:00 => 3
10:00 => 2
11:00 => 1
)
array_column+array_count_values