Does anyone have any experience in saving an Excel spreadsheet via php? Here is my situation:
I need to create an Excel file and save it on the server. (It is eventually emailed as an attachment to someone.) Thus it needs to be a flat xls file, not a dynamic php file with php headers for Excel.
So far, I can successfully create and save the .xls file (populated with xhtml table data), but the file appears to have some issues, and needs to be resaved in Excel before the data can be processed -- I am guessing it is because when saving the file there is no reference to any document headers, though I am not sure about this.
Very grateful if you can help with some code. Currently I am simply using fwrite() to save the file called "test.xls".
Thanks,
Geoff
please help - Creating a .xls file with PHP
Moderator: General Moderators
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: please help - Creating a .xls file with PHP
Take a look at libraries developed specially for reading/writing Excel files such as PHPExcel