How To Read an Excel File Using PHP

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
amkali
Lance Naik
Posts: 33
Joined: Sat Aug 03, 2002 9:53 pm
Location: Lahore, Pakistan

How To Read an Excel File Using PHP

Postby amkali » Fri Sep 17, 2004 5:58 pm

Hello

I want to read data from an Excel file how can it be done in PHP. i have searched the web but cant file a simple script using purely PHP. I need a script that do not use some external dlls.

Can someone send me the code or maybe a referral to a site that can be a helpful resource






thanx

----------------------------------------
Allah s Gr8
Life s Good
Linux s koool

s7r1k3r
Battalion Quarter Master Havaldaar
Posts: 221
Joined: Wed Aug 07, 2002 3:02 pm
Location: Rawalpindi

solutions

Postby s7r1k3r » Sun Sep 19, 2004 6:08 am

Assalam-O-Alaekum!

There are two solutions:

1. If you are using php from windows, you can use the COM functions to open and use the Excel object model (just like in VBA).

2. You can convert the excel files to CSV (Command seperated values) and then can easily read them just like a text file.
a10n3 s7r1k3r

whizkid
Cadet
Posts: 8
Joined: Sat Oct 16, 2004 8:18 pm
Location: Karachi
Contact:

perl an option?

Postby whizkid » Sat Oct 16, 2004 9:02 pm

If Perl is an option, you could look into Spreadsheet::WriteExcel. I'm sure I saw a similar module for PHP somewhere but I don't remember. Let me know if you really *need* to do it in PHP! This module does not require any external components whatsoever and can work with Binary Excel files.

Have fun!

s7r1k3r
Battalion Quarter Master Havaldaar
Posts: 221
Joined: Wed Aug 07, 2002 3:02 pm
Location: Rawalpindi

I am interested in that module.

Postby s7r1k3r » Sun Oct 17, 2004 5:22 pm

Assalam-O-Alaekum!

If you can recall the name of the module, it would be of great help. I would be interested in knowing about it since I also usually get to work with excel files via php.

Regards,
a10n3 s7r1k3r

whizkid
Cadet
Posts: 8
Joined: Sat Oct 16, 2004 8:18 pm
Location: Karachi
Contact:

here you go

Postby whizkid » Sun Oct 17, 2004 6:26 pm


AbuTalha
Lance Naik
Posts: 24
Joined: Fri Aug 27, 2004 7:01 pm
Location: Islamabad
Contact:

Postby AbuTalha » Thu Feb 10, 2005 3:59 am

Assalam o Alaikum

whizkid, you got a kool site, i really appreciates what you did on your site, the urdu translation, though it lacks some of the things, but you have done very very very good ,

May Allah give you more courage to make something more good like this and improve your current software.

If you need any help in any regard you can contact me any time.

wasalam
Some how i will be a linux guru


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest