Computer Science Canada PHP to excel |
Author: | alt+f4 [ Tue Mar 20, 2007 10:08 am ] |
Post subject: | PHP to excel |
I have a question about i script i made for a website i am working on. There is a html form feild that asks the user to enter their priority code to enter the rest to the site. Currently the priority code is written to a .txt file also the date when the user entered that code is written to the file. My question is would it be possible to write all that information to an microsoft excel file because right now it is very hard to read the collected information. you can view and exemple of this script here www.ejayforschools.com enter the priority code "compsci" without the quotes Thanks in advance [/url] |
Author: | rdrake [ Tue Mar 20, 2007 10:23 am ] |
Post subject: | Re: PHP to excel |
Excel uses a not-so-open format with the extension .xls. However, it can also open up various other formats. The easiest way to do this would probably be to export to a CSV (Comma Separated Values) file which is built into PHP >= 5.1.0. You can of course open this CSV file with Excel and still view the file in a nicer way than plain text, albeit minus pretty formatting. At least your columns would be lined up. You might be interested in the fputcsv function. |