<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_19491"> 统计重复的值 <div class="blockcode"> <div id="code_YvV"><ol> <li><?php<li> $array=array(1,2,3,4,5,6,8,5,2,3,6,3,5,2,3,6,5,2,2);<li> print_r($array);<li> echo '<hr>';</li> <li> $b=array_count_values($array);//统计重复值</li> <li> foreach($b as $key=>$value){</li> <li> if($value>1){</li> <li> echo '重复值'.'<font color=red>'.$key.'</font>'.'---------'.'重复次数'.$value.'<br>';</li> <li> }</li> <li> }</li> </ol></div> <em onclick="copycode($('code_YvV'));">复制代码</em> </div> </td></tr></table> <div id="comment_19491" class="cm"> </div> <div id="post_rate_div_19491"></div> <br><br>