vrypan — panayotis vryonis
My blog is a digital scrapbook of ideas, thoughts and personal events. My home is vrypan.net.
Home — Archive: All · English · Greek — RSS Feeds: full feed · other options
#web-devel #en

Parsing XLS files with PHP

We (at work) often offer clients the solution to batch upload data to a web site using excel files. The obvious alternative is to uplad a tab delimeted text file, but then you have to explain to the end user how to save the excel file to text (which is puting the client do our job in a way..).

The solution we had so far was to use xlhtml on the server side to transform the XLS file to XML. Then it is relatively easy to parse it using PHP. This worked quite fine for as long as we were on a Linux server (where compiling and running xlhtml is straight forward).

Lately we had to implement similar functionality (in PHP too) on an IIS (the MS equivelent of Apache) running on Windows NT. The solution Alex came up with was to use PHP-ExcelReader, an excelent library that can parse an XLS file and return a PHP array. It works like a charm!

Do you know of any alternatives?

Share this post:
The Letter is a newsletter I send out whenever I have something to say or share. It may take a few days, weeks or months for the next one.
Privacy: I hate spam as much as you do, maybe more. I will not share your email with advertisers, etc.