Answers for "get the number of occurence of an \ elements in an array php"

PHP
0

php count occurrences of string in array

$array = array('', '', 'other', '', 'other');

$counter = 0;
foreach($array as $value)
{
  if($value === '')
    $counter++;
}
echo $counter;
Posted by: Guest on October-08-2021

Code answers related to "get the number of occurence of an \ elements in an array php"

Browse Popular Code Answers by Language