// 引入PHPEXCEL文件 require_once('PHPExcel/PHPExcel/IOFactory.php'); // 文件路径 $filePath = 'test.xlsx'; $reader = \PHPExcel_IOFactory::createReaderForFile($filePath); $PHPExcel = $reader->load($filePath, 'utf-8'); $sheet = $PHPExcel->getSheet(0); $highestRow = $sheet->getHighestRow(); $highestColumm = $sheet->getHighestColumn(); $data = array(); for($rowIndex=1;$rowIndex<=$highestRow;$rowIndex++){ for($colIndex='A';$colIndex<=$highestColumm;$colIndex++){ $addr = $colIndex . $rowIndex; $cell = $sheet->getCell($addr)->getValue(); if($cell instanceof PHPExcel_RichText){ $cell = $cell->__toString(); } $data[$rowIndex][$colIndex] = $cell; } }
PHPEXCEL读取EXCEL文件
本文为原创,转载请注明:http://www.guanxin365.cn
本栏推荐
nginx-1.9.15,mysql-5
百度地图 服务端 SN校验方式
PHPEXCEL读取EXCEL文件
PHPEXCEL导出EXCEL文件
PHPEXCEL读取日期格式数据
点击排行
PHP数组和XML相互转换
百度地图 服务端 SN校验方式
PHPEXCEL读取日期格式数据
PHPEXCEL读取EXCEL文件
PHPEXCEL导出EXCEL文件