Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php count amount of times a value appears in array

$tmp = array_count_values($uid);
$cnt = $tmp[12];
//Or
$cnt = count(array_filter($uid,function($a) {return $a==12;}));
//In both cases $var will be a number
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #count #amount #times #appears #array
ADD COMMENT
Topic
Name
8+6 =