PhpSpreadsheet/samples/20_Read_Ods_with_PCLZip.php

15 lines
463 B
PHP
Raw Normal View History

<?php
require __DIR__ . '/Header.php';
2016-10-06 11:39:10 +00:00
// Use PCLZip rather than ZipArchive to read the Xlsx OfficeOpenXML file
\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP);
$filename = __DIR__ . '/templates/OOCalcTest.ods';
$callStartTime = microtime(true);
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
$helper->logRead('Ods', $filename, $callStartTime);
// Save
$helper->write($spreadsheet, __FILE__);