This simple class allows you via PHP to export an XML Spreadsheet compatible with all versions of Excel 2003 and up.
The files generated will work with versions of Office 2003 and up. It is considered production safe, and is currently in use in a fair number of production sites.
Unlike CSV or HTML Table exports, you can have multiple worksheets of data! A sheets data can be added to the spreadsheet either by a MySQL query resource or as a 2 dimensional array.
require('includes/classes/XSpreadsheet.php');
$spread = new XSpreadsheet($fname)
$spread->AddWorksheet('Products', mysql_query("Select * From products"))
->AddWorksheet('Categories', mysql_query("Select * From categories"))
->Generate()->Send();
require('includes/classes/XSpreadsheet.php');
$data = array(
array( 'Column 1', 'Column 2', 'Column 3' ),
array( 1, 2, 3 ),
);
$spread = new XSpreadsheet($fname)
$spread->AddWorksheet('Awesome Sheet', $data )
->Generate()->Send();