Skip to content

Instantly share code, notes, and snippets.

@jgdoncel
Created May 30, 2014 16:11
Show Gist options
  • Save jgdoncel/9a83b2b339532c381efc to your computer and use it in GitHub Desktop.
Save jgdoncel/9a83b2b339532c381efc to your computer and use it in GitHub Desktop.
Detectar y eliminar el BOM de un fichero de texto
// 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