PHPExcel Reader Example #07
Simple File Reader Loading a Single Named WorkSheet
';
$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
echo 'Loading Sheet "',$sheetname,'" only
';
$objReader->setLoadSheetsOnly($sheetname);
$spreadsheet = $objReader->load($inputFileName);
echo '
';
echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded
';
$loadedSheetNames = $spreadsheet->getSheetNames();
foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) {
echo $sheetIndex,' -> ',$loadedSheetName,'
';
}
?>