How to generate an Excel document with multiple worksheets from PHP?

后端 未结 4 1254
执笔经年
执笔经年 2020-11-29 00:36

I want to generate an MS Excel file from PHP. I know one can do something like this:

header ( \"Content-type: application/vnd.ms-excel\" );
header ( \"Conten         


        
4条回答
  •  盖世英雄少女心
    2020-11-29 01:29

    If you mean like have your PHP script create an Excel file, write some stuff to it on any sheet, etc, then offer that up for the client to download, you can just use PHP's built-in COM extension. See: http://us2.php.net/manual/en/class.com.php for all sorts of examples. However, you will need Excel (or a clone like OpenOffice) installed on the server. If you don't, perhaps Mark Baker's answer above will work instead without it.

提交回复
热议问题