[go: up one dir, main page]

Voting

: max(six, nine)?
(Example: nine)

The Note You're Voting On

keneks at gmail dot com
18 years ago
Taking the advantage of array_unique, here is a simple function to check if an array has duplicate values.

It simply compares the number of elements between the original array and the array_uniqued array.

<?php

function array_has_duplicates(array $array)
{
$uniq = array_unique($array);
return
count($uniq) != count($array);
}

?>

<< Back to user notes page

To Top