PhpSpreadsheet Reader Example #17
Simple File Reader Loading Several Named WorkSheets
';
$reader = IOFactory::createReader($inputFileType);
/* Read the list of Worksheet Names from the Workbook file **/
echo 'Read the list of Worksheets in the WorkBook
';
$worksheetNames = $reader->listWorksheetNames($inputFileName);
echo 'There are ',count($worksheetNames),' worksheet',((count($worksheetNames) == 1) ? '' : 's'),' in the workbook
';
foreach ($worksheetNames as $worksheetName) {
echo $worksheetName,'
';
}
?>