array_unique($arrary) function;
1.
<?php
function removeDuplicates($nums){
$nums=array_unique($nums);
return $nums;
}
print_r (removeDuplicates([3, 5, 1,2,3, 5]));
?>
2.
<?php
function removeDuplicates($nums){
$result=[];
foreach ($nums as $num){
if (!in_array($num, $result)){
$result[]=$num;
}
}
return $result;
}
print_r (removeDuplicates([3, 5, 1,2,3, 5]));
?>