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

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

WBOY
Release: 2016-06-13 13:15:41
Original
950 people have browsed it

关于采集后对数据编码转换的问题!请教!
我在做一个采集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

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