gb2312 和utf8 互相转码
/** * gb2312转换utf8编码 * @param $str * @return mixed */ public static function gb2utf($str) { return iconv("gb2312","utf-8//IGNORE",$str); }
/** * utf8转换gb2312编码 * @param $str * @return mixed */ public static function utfgb2($str) { return iconv("utf-8","gb2312//IGNORE",$str); }