本文
介绍了跨
浏览器PHP
下载文件名中的
中文随机码问题的
解决方案,供大家
参考:
复制代码代码如下:< PHP
UA _server美元美元{ =http_user_agent};
文件名为中文文件名;
encoded_filename美元= urlencode($文件名);
encoded_filename美元= str_replace(+
头('content-type:应用/字节流);
如果(preg_match( / / MSIE
头('content-disposition:附件文件名=。encoded_filename美元。);
} else if(preg_match( / / 火狐
头('content-disposition:依恋;文件名=UTF8 。$文件名;
{人}
头('content-disposition:附件文件名=。文件名;
}
print'abc;
>
希望本文能对大家的PHP
程序设计有所帮助。