数码资讯
跨浏览器php下载文件名中乱码的解决方案
本文介绍了跨浏览器PHP下载文件名中的中文随机码问题的解决方案,供大家参考: 复制代码代码如下:< PHP UA _server美元美元{ =http_user_agent}; 文件名为中文文件名; encoded_filename美元= urlencode($文件名); encoded_filen
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
本文介绍了跨浏览器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程序设计有所帮助。
复制代码代码如下:< 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程序设计有所帮助。
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。