1$cnt = count(array_filter($array,function($element) {
2 return $element['your_key']=='foo';
3}));
1$tmp = array_count_values($uid);
2$cnt = $tmp[12];
3//Or
4$cnt = count(array_filter($uid,function($a) {return $a==12;}));
5//In both cases $var will be a number