php count array with key[id] = value 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';
}));