I have an array which is 2D and I want to remove duplicates from it,
the var dump look like this 1=>abc.com. 2=>acc.com, 3=>abc.com
so I want to remove the second occurence of abc.com, that is I want to remove 3=>abc.com
,
I tried to use the nested loop, but the code is not working.
foreach ($var as $m)
{
foreach ($var as $s)
{
if(isset($m['Email'])){
if($m['Email'] == $s['Email']){
echo 'matched with '.$s['Email'];
echo '</br>';
unset($s);
//echo $v['Email'];
//echo "<br>";
}
}
}
}
Am I missing something?