Format text in Excel file via PHP

前端 未结 6 479
小鲜肉
小鲜肉 2020-11-29 13:24

I\'m loading data from my database, and exporting to an Excel file via a method I found on this site: http://www.appservnetwork.com/modules.php?name=News&file=article&am

6条回答
  •  旧巷少年郎
    2020-11-29 14:12

    Depending on the speed in which you wish to deploy your solution, one method is to just use the HTML table tag, store all your data in tables using style markup, and then use PHP header's option to force the browser to save is as a .xls file.

    For proof of concept, copy this code into notepad, save as .xls, and then open with Excel:

    Column 1Column 2
    Answer 1Answer 2
    Answer 3 with 2 columns

    Its not the most elegant solution, but it will absolutely suit your needs.

提交回复
热议问题