PHPExcel Reader Example #08
Simple File Reader Loading Several Named WorkSheets
';
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
echo 'Loading Sheet',((count($sheetnames) == 1) ? '' : 's'),' "',implode('" and "',$sheetnames),'" only
';
$objReader->setLoadSheetsOnly($sheetnames);
$objPHPExcel = $objReader->load($inputFileName);
echo '
';
echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded
';
$loadedSheetNames = $objPHPExcel->getSheetNames();
foreach($loadedSheetNames as $sheetIndex => $loadedSheetName) {
echo $sheetIndex,' -> ',$loadedSheetName,'
';
}
?>