-1

我已经加载了库并让示例代码工作。问题是我在任何地方都看不到或阅读如何关闭 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/

4

1 回答 1

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.

希望这可以帮助那里的人。如果对你有帮助,请加个赞。

于 2017-12-26T19:37:36.503 回答