PhpSpreadsheet/samples/07_Reader.php

17 lines
519 B
PHP

<?php
require __DIR__ . '/Header.php';
// Create temporary file that will be read
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
$filename = $helper->getTemporaryFilename();
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet);
$writer->save($filename);
$callStartTime = microtime(true);
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
$helper->logRead('Excel2007', $filename, $callStartTime);
// Save
$helper->write($spreadsheet, __FILE__);