Organizational Research By

Surprising Reserch Topic

Question:how to to find the duplicates in an array in php?



asked Sep 13, 2013 in PHP by rajesh
edited Sep 12, 2013
0 votes
21 views



Related Hot Questions

1 Answer

0 votes

 

array_diff_assoc function can also be used to find the duplicates in an array 
 
$arr = array('1','2','3','4','3','2','5'); 
$uniques = array_unique($arr); 
$dups = array_diff_assoc($arr, $uniques); 
 
print_r($dups); 
?> 
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013

...