Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php count array elements with specific key

$cnt = count(array_filter($array,function($element) {
  return $element['your_key']=='foo';
}));
 
PREVIOUS NEXT
Tagged: #php #count #array #elements #specific #key
ADD COMMENT
Topic
Name
4+5 =