<?php
print_r(removeDuplicate_1([2,4,7,5,7,4,1]))."\n";
print_r(removeDuplicate_1([3,5,0,0,1,2,6,6]))."\n";
//Using array_unique function
function removeDuplicate_1($nums){
return array_unique($nums);
}
function removeDuplicates_2($nums){
$nums=[];
foreach ($nums as $num){
if (!in_array($num,$result)){
$result[]=$num;
}
}
return $result;
}