Created
March 19, 2022 09:41
-
-
Save farhadhp/6f86179eefc85041acb71bec2cbeb2ff to your computer and use it in GitHub Desktop.
Remove UTF8 Bom in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove UTF8 Bom | |
function removeUtf8Bom($text) | |
{ | |
$bom = pack('H*', 'EFBBBF'); | |
$text = preg_replace("/^$bom/", '', $text); | |
return $text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment