Skip to content

Instantly share code, notes, and snippets.

@3D-I
Last active September 14, 2019 08:46
Show Gist options
  • Save 3D-I/bfeb8181c464223238a8 to your computer and use it in GitHub Desktop.
Save 3D-I/bfeb8181c464223238a8 to your computer and use it in GitHub Desktop.
<?php
// hexa code: EF BB BF
// displayed in browsers with:  - UTF8 files
static function remove_bom($str = '')
{
if (substr($str, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf))
{
$str = substr($str, 3);
}
return $str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment