PHPExcel Reader Example #19

Reading WorkSheet information without loading entire file

'; $objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $worksheetData = $objReader->listWorksheetInfo($inputFileName); echo '

Worksheet Information

'; echo '
    '; foreach ($worksheetData as $worksheet) { echo '
  1. ', $worksheet['worksheetName'], '
    '; echo 'Rows: ', $worksheet['totalRows'], ' Columns: ', $worksheet['totalColumns'], '
    '; echo 'Cell Range: A1:', $worksheet['lastColumnLetter'], $worksheet['totalRows']; echo '
  2. '; } echo '
'; ?>