请问怎么查数组中的重复内容

WBOY
Release: 2016-06-23 14:15:24
Original
746 people have browsed it

请问怎么查数组中的重复内容?并显示出来


回复讨论(解决方案)

什么叫数组中重复的内容,把问题描述清楚别人才好回答!

$a=array("Cat","Dog","Horse","Dog");$c=array_count_values($a); foreach($c as $k=>$v){    if($v>1) $ar[]=$k;}print_r($ar);
Copy after login

 Array
(
    [0] => Dog
)

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template