function checkBOM ($filename) {
$contents = file_get_contents($filename);
$charset[
$charset[
$charset[
if (ord($charset[
$rest = substr($contents
rewrite $rest;
}else{
return false;
}
}
From:http://tw.wingwit.com/Article/program/PHP/201311/21072.html