Vinu Thomas has a new post to his blog looking at using the MS-Excel Stream Handler class to push your data out to Excel (in more than just a CSV file).
If you’re looking for an easy way to output your data from a PHP script into a Excel file, you’ve got to check out this script which I came across at the PHP Classes site. What this script essentially does is to implement a stream handler interface to write Microsoft Excel spreadsheet files.
Code snippets are included showing how to structure the data for the import and how to push that generated Excel file out to the user's waiting client.