Thursday, September 10, 2009

php excel export

I've been looking long and hard, and haven't really found a simple way to do this except:


$file="test.xls";
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment;filename=".$file );
header('Pragma: no-cache');
header('Expires: 0');

echo '';
echo '';
echo '';
echo '
QuesionsdnfidAnswer
321123
';


?>