php 使用curl 中文乱码问题

WBOY
Release: 2016-06-23 13:50:07
Original
1715 people have browsed it

在使用php语言做 服务器端重定向时可能会出现中文乱码问题?

解决方法也是很简单的:

 $contents= file_get_contents('http://www.yitire.com/'); // 获取 页面内容 $en_contents=mb_convert_encoding($contents, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5');  // 对页面内容进行编码
Copy after login

这种服务器端跳转有个不好的地方是:不能传递session 和cookie ,不过也有相应的方法解决。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!