$filename = ‘hehe.xls‘;
header (‘Content-type: text/html; charset=UTF-8‘);
header ( "Content-type:application/vnd.ms-excel; charset=UTF-8");
header ( "Content-Type: application/download" );
header ( "Content-Disposition:filename=$filename" );
echo "一\t";
echo "\n";
$result[‘province‘] = ‘嘿嘿1‘;
$result[‘city‘] = ‘嘿嘿2‘;
$result[‘postcode‘] = ‘嘿嘿3‘;
foreach($result as $k=>$v){
echo "$v\t\n";
}
原文地址:http://www.cnblogs.com/tlijian/p/3865797.html