PhpSpreadsheet Reader Example #04

Simple File Reader using the IOFactory to Identify a Reader to Use

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