Home > Backend Development > PHP Tutorial > php-excel-reader条件查询

php-excel-reader条件查询

WBOY
Release: 2016-06-20 12:29:20
Original
1210 people have browsed it

php-excel-reader
我想查询, excel里, A列(即工号) 等于  tester 的那一行数据记录。。。


回复讨论(解决方案)

//test.xls 表格数据如下
//注明, 工号, 那列是第一行 , tester 第二行
工号     名称    基本工资    实发工资   合计
tester   test     11          222       333
tester2  test2    22          333       555

从 A2,B1,C1.... 查看 value是否为 tester(假定找到行为 r)
从 Ar,Br,Cr....直到有效列结束,依次取出

懂了,想到办法了,还是用if条件判断。
for ($i = 1; $i sheets[0]['numRows']; $i++) { 
if ($data->sheets[0]['cells'][$i][1] == 1114){
for ($j = 1; $j sheets[0]['numCols']; $j++) { 
echo $data->sheets[0]['cells'][$i][$j].' '; 


}

Related labels:
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