时间:2021-07-01 10:21:17 帮助过:2人阅读
- <br><!--?php <BR-->$str=':http://www.bitsCN.com'; <br>echo mb_convert_encoding($str, "UTF-8"); //编码转换为utf-8 <br>?> <br> <br><u></u> 代码如下:<pre class="brush:php;toolbar:false layui-box layui-code-view layui-code-notepad"><ol class="layui-code-ol"><li><br><!--?php <BR-->$str=':http://www.bitsCN.com'; <br>echo mb_convert_encoding($str, "UTF-8", "GBK"); //已知原编码为GBK,转换为utf-8 <br>?> <br> <br><u></u> 代码如下:<pre class="brush:php;toolbar:false layui-box layui-code-view layui-code-notepad"><ol class="layui-code-ol"><li><br><!--?php <BR-->$str=':http://www.bitsCN.com'; <br>echo mb_convert_encoding($str, "UTF-8", "auto"); //未知原编码,通过auto自动检测后,转换编码为utf-8 <br>?> <br><br>PHP下编码转换函数mb_convert_encoding与iconv的使用说明 </li></ol></pre></li></ol></pre>