Home > php教程 > php手册 > body text

php转码函数

WBOY
Release: 2016-06-06 19:37:32
Original
1107 people have browsed it

无详细内容 无 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
Copy after login
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;

} 



}
Copy after login
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template