PHP icov转码报错解决方法,iconv(): Detected an illegal character in input string

iconv(): Detected an illegal character in input string 错误解决方法

 

//转码
function iconv_gbk_to_uft8($string){

    if (!$string){
        return '';
    }

    $encode = mb_detect_encoding($string,array("ASCII","GB2312","GBK",'BIG5','UTF-8'));

    return iconv($encode, "UTF-8",$string);


}

 

posted @ 2018-07-20 15:24  后土·K  阅读(1564)  评论(0编辑  收藏  举报