Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php count occurrences of string in array

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

$counter = 0;
foreach($array as $value)
{
  if($value === '')
    $counter++;
}
echo $counter;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #count #occurrences #string #array
ADD COMMENT
Topic
Name
9+8 =