PHP 自动检测编码转换
程序员文章站
2022-06-14 11:13:38
...
跳至
//自动检测内容是编码进行转换 get_encoding($data,"GB2312"); function get_encoding($data,$to) { $encode_arr = array('UTF-8','ASCII','GBK','GB2312','BIG5','JIS','eucjp-win','sjis-win','EUC-JP'); $encoded = mb_detect_encoding($data, $encode_arr); $data = mb_convert_encoding($data,$to,$encoded); return $data; }
下一篇: 体育彩票排列三组选三算法分享_PHP