php汉字乱码转换,gbk和utf8互转

function change_utf8($str) {
    return mb_convert_encoding($str, 'utf-8', 'gbk');
}
function change_gbk($str) {
    return mb_convert_encoding($str, 'gbk', 'utf-8');
}

你可能感兴趣的:(php汉字乱码转换,gbk和utf8互转)