phpexcel导出中文文件名出错
header(content-disposition: attachment;filename=$filename);
$filename是中文的话下载到的文件就是.php的 英文的话可以
------解决思路----------------------
试试
$user_agent = $_server['http_user_agent'];
$encode_filename = rawurlencode($filename);
if(preg_match(/msie/, $user_agent)){
header('content-disposition:attachment; filename='.$encode_filename.'');
}else if(preg_match(/firefox/, $user_agent)){
header(content-disposition:attachment; filename*=\utf8''.$filename.'');
}else{
header('content-disposition:attachment; filename='.$filename.'');
}
------解决思路----------------------
1、header(content-disposition: attachment;filename=$filename); 必须是不含路径的纯文件名
2、phpexcel 默认字符集是 utf-8,一般人都采用浪费资源的 utf-8 保存程序文件。这就不可避免的可能有 bom 头