-
-
$str='脚本学堂:http://bbs.it-home.org';
- echo mb_convert_encoding($str, "utf-8"); //编码转换为utf-8
$str='程序员之家:http://bbs.it-home.org';
- echo mb_convert_encoding($str, "utf-8", "gbk"); //已知原编码为gbk,转换为utf-8
$str='程序员之家:http://bbs.it-home.org';
- echo mb_convert_encoding($str, "utf-8", "auto"); //未知原编码,通过auto自动检测后,转换编码为utf-8
- ?>
-
复制代码
|