php下gbk编码中文乱码的解决办法:首先查看网页编码,代码为【document.characterSet】;然后转换编码从gbk转成【utf-8】,代码为【$contents=mb_convert_encoding($content】。

php下gbk编码中文乱码的解决办法:

1.查看网页编码

打开浏览器控制台查看编码

document.characterSet

2.转换编码

从gbk转成utf-8

$结果字符串 = mb_convert_encoding($原字符串, "目标便编码","原编码");
$contents = mb_convert_encoding($contents, "utf-8","gbk");

相关学习推荐:php编程(视频)