I am currently trying to figure out the best way to create a .xls file from PHP. It seems like to me that all I need to do is change the header content type to \"application
You could use one of the XML formats that Microsoft Office understands.
See Microsoft's OpenXML Developer site for details/specs.
There is a library on called PHPExcel that you can look at to help you with this.
Of course, this all depends on what you mean by:
"get the most out of that file format"
If you just have simple tables with no formatting, CSV files may be all you need; however, if you want to use more features of a spreadsheet, I would recommend taking a look at OpenXML.