tags:

views:

381

answers:

3
A: 

A quick Google search for "PHP excel parser" turns up PHP Excel Reader, for an open source library to use for reading data from .xls files. There may be others that suit your needs.

GApple
Thanks!Do you think it is tough to write my own function to read an excel file using PHP?
chupinette
As far as I know xls files are in a binary format, so it could be very difficult to create your own file parser instead of using an existing one. Since it's open source software, they have probably found and fixed many bugs that you will run into on your own as well.
GApple
A: 

I have been successfully using the 'ABC Excel Parser Pro' from Zakkis.

This allows converting from a XLS file directly into a MySQL table.

A few notes on limitations:

  • column count must match exactly to database columns
  • Excel 2007 format (xlsx) are not supported
John M
Thanks for your reply
chupinette
+1  A: 

i often let admin users upload a csv file they exported from an xcel file, its much simpler to parse through using http://php.net/manual/en/function.fgetcsv.php

David Morrow
Totally, Get the user to upload a CSV file. They can save as CSV from within Excel.
Tim