1、获取当前字符串编码
$encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK"));
2、将字符串编码转为UTF-8
$str = mb_convert_encoding($str, 'UTF-8', $encode);
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
1、获取当前字符串编码
$encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK"));
2、将字符串编码转为UTF-8
$str = mb_convert_encoding($str, 'UTF-8', $encode);
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
PHP检测当前字符串编码并转码UTF-8
txttool.com 说一段 esp56物联 查询128 IP查询