最简单的php生成excel电子表格
ob_start();
define("FILETYPE","xls");
header("Content-type:application/vnd.ms-excel");
if(FILETYPE=="xls")
header("Content-Disposition:filename=report.xls");
else
header("Content-Disposition:filename=report.csv");
echo "姓名\t年龄\t性别\n";
//echo "efg\t\hij\t\n";
echo "张三\t25\tmale";
echo "\n李四\t27\tmale";
echo "\n王五\t20\tfemale";
?>

alert('boy hackerson');window.location.href='http://baidu.com'