require_once 'PHPExcel/IOFactory.php'; $inputFileName = 'example.xlsx'; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
require_once 'PHPExcel/IOFactory.php'; $inputFileName = 'example.csv'; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
require_once 'PHPExcel/IOFactory.php'; $inputFileName = 'example.html'; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
require_once 'PHPExcel/IOFactory.php'; $inputFileName = 'example.ods'; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);In the above examples, we have loaded different file formats using PHPExcel_IOFactory load method. It automatically detects the file format and returns the PHPExcel object that can be used to manipulate the data easily. Overall, PHPExcel_IOFactory is a useful class in the PHPExcel library that allows us to load different spreadsheet file formats easily.