文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>字符编码间的转换

字符编码间的转换

时间:2007-09-30  来源:liuxingyuyuni


mb_convert_encoding 方法
?php
    header("content-Type: text/html; charset=gb2312");
   
    /* Convert EUC-JP to UTF-7 */
    $str = "是是是是是非曲直";
    $strTest1 = mb_convert_encoding($str, "UTF-8", "GB2312");
    $strTest2 = mb_convert_encoding($str, "GB2312", "UTF-8");
    echo $strTest1;
    echo "
";
    echo $strTest2;
?>

iconv 方法
//将$convertString 由gb2312编码转化为UTF-8,不过服务器不一定支持
?php
echo iconv("GB2312", "UTF-8", $convertString);
?>



相关阅读 更多 +
排行榜 更多 +
无敌赛车王

无敌赛车王

赛车竞速 下载
多人汽车聚会

多人汽车聚会

赛车竞速 下载
漂移基地

漂移基地

赛车竞速 下载