自身页面是Utf-8的,现在用file_get_contents函数获取远程页面,被获取的页面是gb2312的,获取到的中文是乱码,怎么办?
很简单,用iconv转换一下
$getcontent = iconv("gb2312", "utf-8",file_get_contents($url));
无论是获取什么编码,中文都不会乱码了。
姓名
Email (为您保密)
个人主页
CopyRight 2007, 幻龙网络 www.01on.com Powered by WordPress 站长:白云山 Email:admin(at)01on点com
Entries (RSS) and Comments (RSS). 19 queries. 0.140 seconds.
JinnStyle V1 Design By Jinn Lynn. Hosting by SiHost.
本站非中国网站,不用备案