自身页面是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@01on.com
JinnStyle V1 Design By Jinn Lynn
Entries (RSS) and Comments (RSS). 34 queries. 0.452 seconds.
粤ICP备05142245号