标签:load 无法 color eth 无法读取 pread pre ++ phpexcel
$filePath = "7788.xls"; $PHPExcel = new PHPExcel(); $PHPReader = new PHPExcel_Reader_Excel2007(); if(!$PHPReader->canRead($filePath)){ $PHPReader = new PHPExcel_Reader_Excel5(); if(!$PHPReader->canRead($filePath)){ die(‘无法读取excel文件‘); } } $PHPExcel = $PHPReader->load($filePath); $currentSheet = $PHPExcel->getSheet(0); $allRow = $currentSheet->getHighestRow(); for($currentRow = 2; $currentRow <= $allRow; $currentRow++){ $a_val = $currentSheet->getCell("A$currentRow")->getCalculatedValue(); $b_val = $currentSheet->getCell("B$currentRow")->getCalculatedValue(); $c_val = $currentSheet->getCell("C$currentRow")->getCalculatedValue(); echo $a_val."\t".$b_val."\t".$c_val."\t"; echo "\n"; }
标签:load 无法 color eth 无法读取 pread pre ++ phpexcel
原文地址:https://www.cnblogs.com/coffee_cn/p/9627755.html