Created
August 18, 2016 14:11
-
-
Save GaryJones/88eed7a60c6196b7ff0e2f744c2ff6ad to your computer and use it in GitHub Desktop.
WASDE XML BOM checker
This file contains hidden or 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
<?php | |
/* | |
* = Instructions = | |
* Save locally as xml-bom.php | |
* Then in terminal, `cd` to the correct folder, and run: | |
* php xml-bom.php | |
*/ | |
$xml = file_get_contents('http://www.usda.gov/oce/commodity/wasde/latest.xml'); | |
define('BOM', "\xEF\xBB\xBF"); | |
if (false !== strpos($xml, BOM) ) { | |
echo 'XML file contains BOM.' . PHP_EOL; | |
} else { | |
echo 'XML file does not contain BOM' . PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment