title: php Removes duplicate values in foreach
body: <p>I have a foreach iterator, there are <code>500 group items</code> in it. How do I remove duplicate values in a foreach? </p>
  
  <pre><code>foreach ($data as $data) {
  if(!empty($data['name'])){  //check if have $data['name']
  $name = $data['name'];
  $id = $data['id'];
  $date = $data['date'];
  $link = $data['link'];
  if(strpos($link, '.ads.')){
  continue; //remove all the link contains `.ads.`
  }else{
  // if `$link` is not repeat, echo the below data. how to use array_unique, remove all the values which repear in `$link` part? 
  echo $name;
  echo $id;
  echo $date;
  echo $link;
  } 
  }
  </code></pre>