Home  >  Article  >  Backend Development  >  关于采集后对数据编码转换的有关问题!请问

关于采集后对数据编码转换的有关问题!请问

WBOY
WBOYOriginal
2016-06-13 13:15:41910browse

关于采集后对数据编码转换的问题!请教!
我在做一个采集title的程序,将采集过来的数据在网页中显示,网页本身是utf8的,我用的是这个函数:
$icn=mb_convert_encoding($arr1,'utf-8','GB2312,GBK,BIG5,utf-8');
实验后发现其他的网页都正常,可要是抓取utf-8编码的网页就会乱码,这怎么解决呢?

------解决方案--------------------
$icn = mb_convert_encoding($arr1, 'utf-8', mb_check_encoding('utf-8')? 'utf-8' : 'GBK');
------解决方案--------------------
icnov

Statement:
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