使用PHPExcel比较excel的内容

时间:2014-03-12 11:31:06

标签: php phpexcel

我正在使用PHPExcel从两个excel文件中读取两个内容列表。阅读成功,我想比较这两个列表的差异。我使用in_array()函数来检查我正在检查的项目是否存在于另一个列表中。其中一些可以被检查,其中一些甚至不能存在这个项目。

//check if string(18) "Multimedia library" ==> ASCII exist in the array below
// as you can see it should be matched at index 0

array(8) { [0]=> string(18) "Multimedia Library" 
[1]=> string(17) "Reference Library" 
[2]=> string(17) "Basic Law Library" 
[3]=> string(41) "Creativity and Innovation Resource Centre" 
[4]=> string(29) "Business and Industry Library" 
[5]=> string(35) "Web-based Education Resource Centre" 
[6]=> string(30) "Sports and Fitness Information" 
[7]=> string(0) "" } 

//encoding of each item in the array above
string(18) "Multimedia Library" ==> ASCII
string(17) "Reference Library" ==> ASCII
string(17) "Basic Law Library" ==> ASCII
string(41) "Creativity and Innovation Resource Centre" ==> ASCII
string(29) "Business and Industry Library" ==> ASCII
string(35) "Web-based Education Resource Centre" ==> ASCII
string(30) "Sports and Fitness Information" ==> ASCII
string(0) "" ==> ASCII

我已检查过从excel读取的每个项目的编码,但找不到任何不同。然而,"多媒体图书馆"在上面的数组中找不到。你有什么可能的理由吗?

0 个答案:

没有答案