/ Published in: PHP

Parameters: $array - haystack, $find-value - needle to check for duplicates
Expand |
Embed | Plain Text
function count_duplicates($array, $find_value) { $counter = 0; foreach($array as $value) { if($value == $find_value) { $counter++; } } return $counter; }
You need to login to post a comment.