PHPExcel - Как я могу читать лист Excel построчно
Как я могу читать листы Excel строка за строкой, используя PHPExcel? У меня есть лист содержит более 100000 строк, но я хочу прочитать только 500 строк.
$sheetData = $objPHPExcel->getActiveSheet();
$highestRow = $sheetData->getHighestRow();
$highestColumn = $sheetData->getHighestColumn();
$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);
echo '<table>';
for ($row = 1; $row <= $highestRow; ++$row) {
echo '<tr>';
for ($col = 0; $col <= $highestColumnIndex; ++$col) {
echo '<td>' . $sheetData->getCellByColumnAndRow($col, $row)->getValue() . '</td>';
}
echo '</tr>';
}
echo '</table>';