I\'m sure this is an extremely obvious question, and that there\'s a function that does exactly this, but I can\'t seem to find it. In PHP, I\'d like to know if my array has
function hasDuplicate($array){ $d = array(); foreach($array as $elements) { if(!isset($d[$elements])){ $d[$elements] = 1; }else{ return true; } } return false; }