首页 > 技术文章 > PHP icov转码报错解决方法,iconv(): Detected an illegal character in input string

aeiou 2018-07-20 15:24 原文

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);


}

 

推荐阅读