Created
May 30, 2014 16:11
-
-
Save jgdoncel/9a83b2b339532c381efc to your computer and use it in GitHub Desktop.
Detectar y eliminar el BOM de un fichero de texto
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
// Comprobar si el fichero trae BOM | |
$bom = pack("CCC", 0xef, 0xbb, 0xbf); | |
if (0 == strncmp($json, $bom, 3)) { | |
$json = substr($json, 3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment