This article mainly introduces the use of PHP to remove the file BOM Header example, the need for friends can refer to the following
Code as follows: function Checkbom ($filename) { global $auto; & nbsp $contents = file_get_contents ($filename); $charset [1] = substr ($contents, 0, 1); $charset [2] = substr ($contents, 1, 1); $charset [3] = substr ($contents, 2, 1); if (Ord ($charset [1]) = = 239 && ord ($charset [2]) = = 187 && Ord ($ch ARSET[3] = = 191) { if ($auto = = 1) { & nbsp $rest = substr ($contents, 3); rewrite ($filename, $rest); return ("<font Color=red>bom found, automatically rem Oved.</font> "); &NBSP; }else { return ("<font color=red> BOM found.</font> "); }else ("BOM not F" Ound. "); }