我已经加载了库并获得了示例代码。问题是我无法在任何地方看到或阅读如何关闭46_ReadHtml.php的屏幕输出
这是我需要关闭的输出:
19:37:47 Read Html format from C:\oerm_dev\www\dev\mindfulemr3\vendor\phpoffice\phpspreadsheet\samples\Basic/../templates/46readHtml.html in 0.2000 seconds
19:37:47 Write Xlsx format to C:\Windows\TEMP/phpspreadsheet/46_ReadHtml.xlsx in 0.0550 seconds
19:37:47 Write Xls format to C:\Windows\TEMP/phpspreadsheet/46_ReadHtml.xls in 0.0390 seconds
19:37:47 Peak memory usage: 4MB
有人能指出我如何关闭它的文件吗?
网站上没有关于示例文件及其工作方式的信息。
https://phpspreadsheet.readthedocs.io/en/develop/topics/reading-and-writing-to-file/
答案 0 :(得分:0)
解决方案:
我想出了@PowerKiKi
时该怎么做https://gitter.im/PHPOffice/PhpSpreadsheet?at=5a42a228e43a7a150caab463
建议我再看一遍上面的链接。暗示一直在底部。我添加了这个。
//$helper->write($objPHPExcel, __FILE__);
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($objPHPExcel, 'Xlsx');
$writer->save('payroll.xlsx');
注释掉所有辅助变量,并通过调用对象编写器替换最后一行。一旦对象阅读器读入文件
$objReader->load($html);
编写器需要实例化并告知从已加载到对象变量的html中编写xlsx文件
$objPHPExcel.
希望这有助于那里的人。如果有帮助,请添加一个upvote。