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
its pretty easy, because excel supports html code. So you just need to add a header in the top of the file.. and then echo your html code!
header ( "Content-type: application/vnd.ms-excel" );
header ( "Content-Disposition: attachment; filename=foo_bar.xls" );
echo "Header1 value1
";
this will generate an excel file!