Maison >développement back-end >tutoriel php >phpexcel导出中文文件名报错
phpexcel导出中文文件名出错
header("Content-Disposition: attachment;filename=$filename");
$filename是中文的话下载到的文件就是.php的 英文的话可以
------解决思路----------------------
试试
<br /> $user_agent = $_SERVER['Http_User_agent']; <br /> $encode_filename = rawurlencode($filename); <br /><br /> if(preg_match("/MSIE/", $user_agent)){ <br /> header('content-disposition:attachment; filename="'.$encode_filename.'"'); <br /> }else if(preg_match("/Firefox/", $user_agent)){ <br /> header("content-disposition:attachment; filename*=\"utf8''".$filename.'"'); <br /> }else{ <br /> header('content-disposition:attachment; filename="'.$filename.'"'); <br /> } <br />