function strToGBK($strText){//将UTF-8字符串转为GBK格式方法 $encode = mb_detect_encoding($strText, array('UTF-8','GB2312','GBK')); if($encode == "UTF-8"){ return @iconv('UTF-8','GB18030',$strText); }else{ return $strText; } }
PHP UTF-8转GBK
最新推荐文章于 2021-11-24 10:40:50 发布