php 判断网页是否是utf8编码的方法
//判断编码复制代码 代码如下:$encode = mb_detect_encoding($q, array(‘GB2312′,’GBK’,’UTF-8′));echo $encode.””;if($encode==”GB2312′′){ $q = iconv(“GBK”,”UTF-8′′,$q);}else if($encode==”GBK”){ $q = iconv(“GBK”,”UTF-8′′,$q);}else if($encode==”EUC-CN”){ $q = iconv(“GBK”,”UTF-8′′,$q);}else//CP936{ //$q = i
用户评论