循环读取
$objPHPExcel = PHPExcel_IOFactory::load('C:\Users\yi.qin\Downloads\入驻申请单6条数据.xlsx');$sheet = $objPHPExcel->getActiveSheet();$highestRow = $sheet->getHighestRow();$highestColumn = $sheet->getHighestColumn();for ($row = 1; $row <= $highestRow; $row++) { for ($column = 'A'; true; $column++) { $cellValue = $sheet->getCell($column . $row)->getValue(); // 业务代码 if ($column == $highestColumn) { break; } }}
循环读取
$objPHPExcel = PHPExcel_IOFactory::load('C:\Users\yi.qin\Desktop\a.xlsx');$sheetData = $objPHPExcel->getActiveSheet()->toArray();if (!empty($sheetData)){ foreach($sheetData as $i => $item){ // 业务代码 }}