/ Published in: PHP
Parameters: $array - haystack, $find-value - needle to check for duplicates
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function count_duplicates($array, $find_value) { $counter = 0; foreach($array as $value) { if($value == $find_value) { $counter++; } } return $counter; }