正文开始 在使用 getHighestRow方法获取列的个数的时候,居然 有 16385 列;即:XFD 列;
这就显然不对了,然而实际上Excel中只有 71 列;
原获取的方式
~~~
$this->PHPReader = \PHPExcel_IOFactory::load($filePath);
$sheet = $this->PHPReader->getActiveSheet();
$this->highestRow = $sheet->getHighestRow();
$this->highestColumm = $sheet->getHighestColumn();
~~~
改造后获取方式
~~~
$this->PHPReader = \PHPExcel_IOFactory::load($filePath);
$sheet = $this->PHPReader->getActiveSheet();
$this->highestRow = $sheet->getHighestDataRow();
$this->highestColumm = $sheet->getHighestDataColumn();
~~~
正文结束 |
PHP接口(interface)和抽象类(abstract) | Zookeeper的PHP实践 |