如何使用PHP将数据写入excel? [英] How can I write data into an excel using PHP?
本文介绍了如何使用PHP将数据写入excel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用PHP fwrite()
将内容附加到.xls文件?
Is it possible to append content to an .xls file using PHP fwrite()
?
当我使用 fwrite()
尝试此操作时,生成的文件在Excel 2007中导致错误消息.
When I try this using fwrite()
, the resulting file causes an error message in Excel 2007.
我可以使用特定的分隔符来完成此操作吗?
Is there a specific separator I can use to accomplish this?
没有第三方库是否有可能?
Is it possible without a third party library?
推荐答案
您可以使用 PhpSpreadsheet 库,以读取现有的Excel文件,向其添加新的行/列,然后将其写回为真实的Excel文件.
You can use the PhpSpreadsheet library, to read an existing Excel file, add new rows/columns to it, then write it back as a real Excel file.
免责声明:我是该库的作者之一.
Disclaimer: I am one of the authors of this library.
这篇关于如何使用PHP将数据写入excel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文