统计重复的值
时间:2021-07-01 10:21:17
帮助过:2人阅读
统计重复的值
- $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);//统计重复值
- foreach($b as $key=>$value){
- if($value>1){
- echo '重复值'.''.$key.''.'---------'.'重复次数'.$value.'
'; - }
- }
|