title: How can we find the Duplicate values in array using php?
body: <p>I would like to know, how can we detect the duplicate entries in array...</p>
  
  <p>Something like </p>
  
  <pre><code>$array = array("192.168.1.1", "192.168.2.1","192.168.3.1","192.168.4.1","192.168.2.1","192.168.2.1","192.168.10.1","192.168.2.1","192.168.11.1","192.168.1.4") ;
  </code></pre>
  
  <p>I want to get the number of Duplicity used in array (C class unique).
   like this </p>
  
  <pre><code>192.168.1.1 = unique
  192.168.2.1 = Duplicate
  192.168.3.1 = unique
  192.168.4.1 = unique
  192.168.2.1 = Duplicate
  192.168.2.1 = Duplicate
  192.168.10.1 = unique
  192.168.2.1 = Duplicate
  192.168.11.1 = unique
  192.168.1.4 = Duplicate (Modified)
  </code></pre>
  
  <p>I tried this code like this style</p>
  
  <pre><code>$array2 = array() ;
  
  foreach($array as $list ){
  
  $ips = $list;
  
  $ip = explode(".",$ips);
  
  $rawip = $ip[0].".".$ip[1].".".$ip[2] ;
  
  array_push($array2,$rawip);
  
  }
  </code></pre>
  
  <p>but i am unable to set the data in right manner and also unable to make the loop for matching the data.</p>
  
  <p>modified values</p>
  
  <p>Thanks </p>
  
  <p>SAM  </p>