$encoding = mb_detect_encoding($line[0]);
if ($encoding == 'UTF-8'){
$bom = substr($line[0], 0, 3);
if ($bom == UTF8_BOM){
// 有BOM的UTF8
}else{
//没有BOM的UTF8
}
}else{
//其他
}
判断UTF8的BOM(encoding判断)
最新推荐文章于 2021-05-04 14:23:51 发布