利用mb_convert_encoding函数将返回的字符串转码成UTF-8编码
if(! mb_check_encoding($result, 'utf-8')) {
$result = mb_convert_encoding($result,'UTF-8',['ASCII','UTF-8','GB2312','GBK']);
}
利用mb_convert_encoding函数将返回的字符串转码成UTF-8编码
if(! mb_check_encoding($result, 'utf-8')) {
$result = mb_convert_encoding($result,'UTF-8',['ASCII','UTF-8','GB2312','GBK']);
}
本文标题:curl返回的中文乱码处理
本文链接:https://www.haomeiwen.com/subject/gdayuxtx.html
网友评论