1. Go to this page and download the library: Download lopo/olef library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
//A xls file should have a Workbook stream
$of = \OleF\OleFile::open('report.xls');
$foundStream = $of->RootStorage->getStream('Workbook');
$temp = $foundStream->getData();
// do something with $temp
$of->close();
// Open existing file in update mode (or create new one first)
$of = \OleF\OleFile::open('existing.cfs', true);
$st = $of->RootStorage->addStorage('MyStorage');
$sm = $st->addStream('MyStream');
$of->RootStorage->delete('AStream'); // 'AStream' item is assumed to exist