coun no of keys of associative array laravel code example
Example: php count array elements with specific key
$cnt = count(array_filter($array,function($element) {
return $element['your_key']=='foo';
}));
$cnt = count(array_filter($array,function($element) {
return $element['your_key']=='foo';
}));