header("Content-type:application/vnd.ms-excel;charset=UTF-8");
$showtime=date("Y-m-d");
header("Content-Disposition:filename=checkin".$showtime.".xls");
echo "一"."\t"."二"."\t\n";
echo "一"."\t"."二"."\t\n";以上代码生成的excel出现乱码,如果大家有其他生成excel的方法,请不吝赐教.......各位大哥帮帮忙,小弟先谢了。
$showtime=date("Y-m-d");
header("Content-Disposition:filename=checkin".$showtime.".xls");
echo "一"."\t"."二"."\t\n";
echo "一"."\t"."二"."\t\n";以上代码生成的excel出现乱码,如果大家有其他生成excel的方法,请不吝赐教.......各位大哥帮帮忙,小弟先谢了。
在windows平台上,ms的excel在识别utf8编码时会以是否具有BOM头为准,如果没有的话,则显示乱码。不妨试试gb2312
stars981:iconv转码 gbk是什么意思?怎么用?
return iconv("UTF-8","GB2312",$String);
}header("Content-type:application/vnd.ms-excel;charset=UTF-8");
$showtime=date("Y-m-d");
header("Content-Disposition:filename=checkin".$showtime.".xls");
$output="";
$output.="一"."\t"."二"."\t\n";
$output.="一"."\t"."二"."\t\n";
echo ConvertString($output);试试吧