utf8_encode()与utf8_decode函数
utf8_encode() 函数把 iso-8859-1 字符串编码为 utf-8。
语法结构: utf8_encode(string);
*/ $str = "你好,世界!" ; //定义字符串 $result =utf8_decode( $str ); //进行编码转换 echo $result ; //输出转换结果utf8_decode() 函数把 utf-8 字符串解码为 iso-8859-1,该函数把用 utf-8 方式编码的 iso-8859-1 字符串转换成单字节的 iso-8859-1 字符串,如果成功,该函数将返回解码字符串;否则返回 false。
语法结构: utf8_decode(string)
<?php */ $str = "hello world!" ; //定义字符串 $result =utf8_decode( $str ); //进行编码转换 echo $result ; $result =utf8_encode( $result ); //进行编码转换 echo $result ; //输出转换结果 ?>查看更多关于utf8_encode()与utf8_decode函数 - php函数的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did30779