load("05featuredemo.xlsx"); echo date('H:i:s') . " Iterate worksheets\n"; foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { echo '- ' . $worksheet->getTitle() . "\r\n"; foreach ($worksheet->getRowIterator() as $row) { echo ' - Row number: ' . $row->getRowIndex() . "\r\n"; $cellIterator = $row->getCellIterator(); $cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set foreach ($cellIterator as $cell) { if (!is_null($cell)) { echo ' - Cell: ' . $cell->getCoordinate() . ' - ' . $cell->getCalculatedValue() . "\r\n"; } } } } // Echo memory peak usage echo date('H:i:s') . " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB\r\n"; // Echo done echo date('H:i:s') . " Done writing files.\r\n";