Count duplicate values
- $array=array(1,2,3,4,5,6,8,5,2,3,6,3,5,2,3,6,5,2, 2);
- print_r($array);
- echo '
';
- $b=array_count_values($array);//Count duplicate values
- foreach($b as $key=>$value){
- if($value>1){
- echo 'Duplicate value'.''.$key.''.'---------'.'Duplicate Times'.$value.'
';
- }
- }
Copy code
|