PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

php中文文名下载乱码解决方法

原创
2016-06-13 09:55:21 1026浏览

解决中文乱码解决方法有很多种,一种是对url编码如urlencode方法,另一种是下面的header头处理方法以binary方法。

$file_name = urlencode($_REQUEST['filename']);
header("Pragma: public"); header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: attachment; filename='.$file_name);
echo strips教程lashes($_REQUEST['content']);
?>
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。