用PHPExcel读取文件,怎么判断某个字段的内容有没有重复

WBOY
Release: 2016-06-23 14:18:34
Original
919 people have browsed it

用PHPExcel读取文件,怎么判断某个字段的内容有没有重复?读取完之后,我想显示重复的内容,没有重复的不显示。

请问怎么判断读取的内容有没有重复


回复讨论(解决方案)

我想需要将数据内容保存到一个数组里 然后用各种数组函数吧



循环excel数据,将需要比较重复字段的值,写入临时数组,如果在临时数组存在,就给那一行数据的列,标示颜色,楼主是需要这样的功能吧。
$temparr = array();
foreach($all_excel as $key=>$value){
if(in_array($temparr,$value['name'])){
    //设置某列颜色
}else{
   将name值写入$temparr
}
}

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