29 Apr
Posted by Ray Cheung as MIT License, Tools
PHP Excel Reader allows you to parse and retrieve information from XLS files. It reads the binary format of XLS files directly and can return values and formats from any cell.
The simplest way to interact with an XLS file is to just dump it to HTML for display in a browser. This method will generate a table with inline CSS and all available formatting. By simply using this php command: <?php dump(true,true); ?> The output looks like this (with some CSS):
Requirements: PHP Framework
Demo: http://code.google.com/p/php-excel-reader/
License: MIT License





This is a great library for PHP, and should solve most peoples problems when handling Excel files. Anyone know of any good (not XML) Excel writers for PHP4/5?
http://code.google.com/p/php-excel-reader2/
As excel writer I am currently using this one:
http://pear.php.net/package/Spreadsheet_Excel_Writer
What are you using?
Hi,
I’m using http:///www.dbTube.org to import an Excel Sheet
Greetings
Andreas
You can create a MS Excel file in the following way with the MS-Excel Stream handler:
$fp = fopen(”xlsfile://temp/excel.xls”, “wb”);
if (!is_resource($fp)) {
die(”Cannot open file”);
}
$data= array(
array(”Team” => “Chelsea”, “Points” => 80,
array(”Team” => “Arsenal”, “Points” => 85,
array(”Team” => “Spurs”, “Points” => 75
);
fwrite($fp, serialize($data));
fclose($fp);
//Simples
Or take a look at PHPExcel ( http://www.phpexcel.net ) which has the benefit of being able to read and write workbooks in a variety of different formats, including both xls and xlsx, and is still actively supported
wow.. thanx guys…
i’m quite new to PHP and i never knew it could export/import from XLS file. surely will take a close look at this one…
This is a great library, no doubt. I only have one problem and is that when i have a large excel doc (about 50.000 lines) the process dies. Any help for that?
Hi,
50′000 rows in Excel? I think you mean the max 47′000
lines limitation of Excel…anymway.
I solve my problem with dbTube by increase the max PHP
memory and increase the script max excution time in my php.ini.
Greetings
Harrald.
@Andreas Herz
I see dbtube.org being mentioned many places in the comments, and I have looked at their site a few times without being convinced this is a sollution of my needs.
Can someone point me to an article or review of this “system”, do I install it in my own system or is it just a service? I need to parse excel files to import data in different systems, having a service for doing this is no good to me. Maby I didnt read the dbtube.org site correctly, but seems to my this is a service and not a system?
Hi,
dbTube.org is a PHP software which can be installed on any
PHP server. It is not a service – dbTube is not Google
In this case you can use it for your private intranet or on
your local, standalone machine.
Requirements: Excel xls, PHP >=5 and mySQL
Greetings
Andreas
RSS feed for comments on this post · TrackBack URI