"Fossies" - the Fresh Open Source Software Archive

Member "ILIAS-5.4.9/libs/composer/vendor/phpoffice/phpspreadsheet/samples/Reader/03_Simple_file_reader_using_the_IOFactory_to_return_a_reader.php" (24 Jan 2020, 509 Bytes) of package /linux/www/ILIAS-5.4.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "03_Simple_file_reader_using_the_IOFactory_to_return_a_reader.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 use PhpOffice\PhpSpreadsheet\IOFactory;
    4 
    5 require __DIR__ . '/../Header.php';
    6 
    7 $inputFileType = 'Xls';
    8 $inputFileName = __DIR__ . '/sampleData/example1.xls';
    9 
   10 $helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType);
   11 $reader = IOFactory::createReader($inputFileType);
   12 $spreadsheet = $reader->load($inputFileName);
   13 
   14 $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
   15 var_dump($sheetData);