If you are new to PHP, it might be easier for you to use it this way.
function chkArrayUniqueElem($arr) {
for($i = 0; $i < count($arr); $i++) {
for($j = 0; $j < count($arr); $j++) {
if($arr[$i] != $arr[$j]) return false;
}
}
return true;
}
Other options listed earlier are easier to use.
source
share