PHPExcel Reader Example #19

Reading WorkSheet information without loading entire file

'; $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $worksheetData = $reader->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 '
'; ?>