Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php check for duplicates in array

function has_dupes($array) {
    $dupe_array = array();
    foreach ($array as $val) {
        if (++$dupe_array[$val] > 1) {
            return true;
        }
    }
    return false;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #check #duplicates #array
ADD COMMENT
Topic
Name
7+2 =