php mb_convert_encoding文字编码转换函数 程序员文章站 2022-04-18 08:16:36 ... $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 ?> 复制代码 相关标签: php mb_convert_encoding文字编码转换函数 上一篇: javascript acos 方法计算反余弦值 下一篇: 汇总三种行内元素转为块级元素的方法 推荐阅读 详谈PHP编码转换问题 分享PHP函数实现数字与文字分页代码 php强大的时间转换函数strtotime PHP学习笔记之字符串编码的转换和判断 用PHP实现将GB编码转换为UTF8 php的数组与字符串的转换函数整理汇总 php支持中文字符串分割的函数 php全角字符转换为半角函数 php实现文件编码批量转换 php的mail函数发送UTF-8编码中文邮件时标题乱码的解决办法