PHPExcel Reader Example #04

Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Identify a Reader to Use

'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with the identified reader type
'; $objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $spreadsheet = $objReader->load($inputFileName); echo '
'; $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?>