Pages

PHP - Find duplicate values in array

 <?php  
 $one = array(1,2,3,4,1,2,3,4,5,6,7);  
 $duplicates = findto($one);  
 function findto($one)  
 {  
   return array_diff_assoc($one, array_unique($one));  
 }  
 echo print_r($duplicates);  

No comments:

Post a Comment