Following is my code:
$array1=('23','3','55','67');
function has_dupes($array1){
$dupe_array = array();
foreach($array1 as $val){
if(++$dupe_array[$val] > 1){
return true;
}
}
return false;
}
I'm new to PHP and wanted to write a function to check an array for duplicate integers. My code is below:
It gives an error: Parse error: syntax error, unexpected ',' on line 1