PHP gbk转换成utf8

/**
* GBK ASCII 转换成utf8
*/
public function to_utf8($str){
$detect = array('ASCII', 'GBK', 'UTF-8');
$encoding = mb_detect_encoding($str, $detect);
$str = mb_convert_encoding($str, 'UTF-8', $encoding);
return $str;
}

原文地址:https://www.cnblogs.com/chuanheng/p/3645645.html