复制代码代次如下:
function checkBOM ($filename) {
$contents = file_get_contents($filename);
$charset[1] = substr($contents, 0, 1);
$文字セット[2] = substr($contents, 1, 1);
$charset[3] = substr($contents, 2, 1);
if (ord($charset[1]) == 239 && ord($charset) [2]) == 187 && ord($charset[3]) == 191) {
$rest = substr($contents, 3);
$rest;
}else{
return false;
}
}
http://www.bkjia.com/PHPjc/327923.htmlwww.bkjia.com本当http://www.bkjia.com/PHPjc/327923.html技術記事関数 checkBOM ($filename) { $contents = file_get_contents($filename); $charset[1] = substr($contents, 0, 1); $charset[2] = substr($contents, 1, 1); $...