1.将PHPExcel文件放入Thinkphp/library/Org/util 目录下
2.在项目中引入PHPExcel。import("Org.Util.PHPExcel");
</pre><pre name="code" class="php">$PHPExcel=new \PHPExcel();
$savePath = './Uploads/'.$info['savepath'].$info['savename'];
$PHPExcel=$PHPReader->load($savePath);
$currentSheet=$PHPExcel->getSheet(0);//读第一个表,如果有多个,修改传递参数
$allColumn=$currentSheet->getHighestColumn();//获取列数
$allRow=$currentSheet->getHighestRow();//获取行数
for($currentRow=2;$currentRow<=$allRow;$currentRow++){
//取数据
$firstName = $currentSheet->getCell("A".$currentRow)->getValue();
}

1万+

被折叠的 条评论
为什么被折叠?



