Answers for "how to get the count of a value from an array in php based on condition"

PHP
3

php count array elements with specific key

$cnt = count(array_filter($array,function($element) {
  return $element['your_key']=='foo';
}));
Posted by: Guest on July-13-2020

Code answers related to "how to get the count of a value from an array in php based on condition"

Browse Popular Code Answers by Language