What is the best way to create XLS file in PHP

后端 未结 9 1277
予麋鹿
予麋鹿 2020-12-05 14:03

I am currently trying to figure out the best way to create a .xls file from PHP. It seems like to me that all I need to do is change the header content type to \"application

9条回答
  •  情话喂你
    2020-12-05 14:50

    You can just output html and newer versions of Excel will read it. I don't know how much formatting you can do with it though.

    If you need data typing, rich formatting or formulas, I have had success with PHPExcel.

    My preference is to write out CSV files. CSV is a very easy format to write and an easy conversion from existing html table scripts. It also has the advantage of being readable by a wide variety of non-microsoft spreadsheet programs. If you can make CSV the file format of choice for your web application, you will reap rewards when you have to accept a spreadsheet as input. It is much, much easier to read and parse a CSV file than an Excel file.

提交回复
热议问题