Home  >  Article  >  php教程  >  php转码函数

php转码函数

WBOY
WBOYOriginal
2016-06-06 19:37:321106browse

无详细内容 无 iconv('GB2312', 'UTF-8', $str); //将字符串的编码从GB2312转到UTF-8 class ChineseTransfer {public static function big5_gb2312($in) {$in = iconv('UTF-8', 'BIG5', $in);$in = iconv('BIG5', 'GB2312', $in);$out = iconv('GB2312', 'UTF

iconv('GB2312', 'UTF-8', $str); //将字符串的编码从GB2312转到UTF-8
class ChineseTransfer {



public static function big5_gb2312($in) {

$in = iconv('UTF-8', 'BIG5', $in);

$in = iconv('BIG5', 'GB2312', $in);

$out = iconv('GB2312', 'UTF-8', $in);

return $out;

}



public static function gb2312_big5($in) {

$in = iconv('UTF-8', 'GB2312', $in);

$in = iconv('GB2312', 'BIG5', $in);

$out = iconv('BIG5', 'UTF-8', $in);

return $out;

} 



}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn