示例HTML到Xlsx转换器中的PHPSReadSheet关闭屏幕报告
我已经加载了库并使示例代码正常工作。问题是我没有看到或阅读到如何关闭46_ReadHtml.php的屏幕输出 这是我需要关闭的输出:示例HTML到Xlsx转换器中的PHPSReadSheet关闭屏幕报告,php,phpspreadsheet,Php,Phpspreadsheet,我已经加载了库并使示例代码正常工作。问题是我没有看到或阅读到如何关闭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
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
有人能给我指一下如何关闭它的文档吗
网站上没有关于示例文件及其工作方式的任何信息
解决方案:
我知道当@PowerKiKi
建议我再看看上面的链接。这个暗示一直在底部。我加了这个
//$helper->write($objPHPExcel, __FILE__);
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($objPHPExcel, 'Xlsx');
$writer->save('payroll.xlsx');
注释掉所有的helper变量,并用对对象编写器的调用替换最后一行。一旦对象读取器读入文件
$objReader->load($html);
编写器需要被实例化,并被告知从加载到对象变量中的html编写xlsx文件
$objPHPExcel.
希望这能帮助其他人。如果这对你有帮助,请加上一张赞成票