Saturday, 28 September 2013

PHP changing .xlsx file by modifying xml files in its zip archive

PHP changing .xlsx file by modifying xml files in its zip archive

I'd like to modify my excel file without using PHPExcel library.
So I tried this:
$zip = new ZipArchive();
$zip->open("invoice.xlsx");
$sheet1 = $zip->getFromName("xl/worksheets/sheet1.xml");
But I got this response:
Warning: ZipArchive::getFromName(): Invalid or unitialized Zip object on
line 3

No comments:

Post a Comment