IAM-XLS is a PHP class for generating an XLS file. Alternatively, it can be used for performing a query dump and sending it to the browser as an Excel File. It allows the user to enter text and numeric values into a Excel spreadsheet. It has browser and OS detection capabilities for appropriate handling of downloads (content-type, etc.).
This class is licensed under the GNU Lesser General Public License (LGPL), so feel free to use it, modify it as you want, although a little credit is always welcome. This class is feature in PHPClasses.org and Freshmeat. Get the Source Code and Documentation