public static function utf8_to_gbk($utfstr) { return iconv("utf-8", "gbk//IGNORE", $utfstr); } static function gbk_to_utf8($gbstr) { return mb_convert_encoding($gbstr, "utf-8", "gbk"); }
utf8 gbk 互转
原文:http://www.cnblogs.com/buxiangxin/p/7439936.html