PhpSpreadsheet/samples/Basic/07_Reader.php

20 lines
539 B
PHP
Raw Normal View History

<?php
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
2017-10-01 08:48:59 +00:00
require __DIR__ . '/../Header.php';
// Create temporary file that will be read
2017-10-01 08:48:59 +00:00
$sampleSpreadsheet = require __DIR__ . '/../templates/sampleSpreadsheet.php';
$filename = $helper->getTemporaryFilename();
$writer = new Xlsx($sampleSpreadsheet);
$writer->save($filename);
$callStartTime = microtime(true);
$spreadsheet = IOFactory::load($filename);
2016-10-06 11:39:10 +00:00
$helper->logRead('Xlsx', $filename, $callStartTime);
// Save
$helper->write($spreadsheet, __FILE__);