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
<?php | |
/** | |
* Given the URL of an XML file, fetch the contents and pass it to _xml_to_array() to be | |
* converted to an associative array. The file is read into a string and then parsed via | |
* simplexml_load_string() (rather than parsed directly with simplexml_load_file()), | |
* because the "LIBXML_NOCDATA" parameter is required in order for CDATA to persist. | |
*/ | |
function _xml_to_array_from_file($url) { | |
$array = NULL; | |
if ($file = file_get_contents($url)) { |