1.mb_detect_encoding — 检测字符的编码;
2.iconv()–将一种已知的字符集文件转换成另一种已知的字符集文件;
3.mb_convert_encoding()–转换字符的编码;
eg:
1.$encode = mb_detect_encoding($str, array(“ASCII”,’UTF-8’,”GB2312”,”GBK”,’BIG5’));
2.$str = iconv(‘GBK’,’UTF-8’,$str);
3.$str = mb_convert_encoding($str ,”utf-8”,”gbk”);
php中字符串编码格式处理
最新推荐文章于 2021-09-16 16:40:36 发布