I'm working with phpspreadsheet. In a part of my code I have to generate a html-object:
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet);
$writer->save($fileNameHTML);
$html = file_get_contents($fileNameHTML);
I need a function without save and load the html file. Maybe something like "$html = $spreadsheet" (not working ;-))
and here is my answer:
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet);
ob_start();
$writer->save('php://output');
$html = ob_get_clean();
My misstake: $html is not an object. It's a string.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.