【问题标题】:PHPSpreadsheet turn off screen report in sample HTML to Xlsx converterPHPSpreadsheet 关闭示例 HTML 到 Xlsx 转换器中的屏幕报告
【发布时间】:2018-06-06 21:13:34
【问题描述】:

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

【问题讨论】:

    标签: php phpspreadsheet


    【解决方案1】:

    解决方案:

    当@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.
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-19
      • 2019-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-03
      相关资源
      最近更新 更多