Export MySQL to Excel in PHP

This code sample exports a single table from MySQL Database to Excel in tab-delimited format.