Skip to content
A simple PHP library to export arrays of data into excel readable xml.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Adding ignore file Mar 20, 2010
README Corrections Mar 22, 2010
php-excel.class.php Implementing fix for issue #1. Mar 22, 2010
test.php Adding php-excel class version 2 and a little test. Mar 22, 2010


php-excel is a really simple library class written in PHP to
dump an array of data into an Microsoft Excel and OpenOffice
Calc readable format. This is version 2 of the older library
still hosted on Google Code at:

The class is inspired by the MySQL Query tool which offers a
simple extraction of database tables into Microsoft's Open XML
format. However, I was always looking for a way to do this in
an app or a website with some data which belongs in a table.

What is it?
The function is simple: You generate an array - even a larger
array, dump it into the class and select whether you want to
write it into an excel-readable file or send this file directly
to your browser.

What isn't?
It can not deal with complex operations or layouts. If you
like to design your tabular data using colors or font-styles
or if you want the excel file to contain formulas, you better
use a much more sophisticated export library. I recommend using
the beautiful:

... which is far more capable of such things.

How to use it?
The usage is very, very simple. Here's the script for adding
a simple array to the php-excel library and sending the file
to the browser (for downloading):


require 'php-excel.class.php';
$mydata = array(1 => 'Oliver Schwarz', 'Friedhelm Hasematzel');
$xls = new Excel_XML;
$xls->addWorksheet('My data', $mydata);


See test.php for more details.
You can’t perform that action at this time.