XML file convert to PHP array



I have a huge XML file, that i want to encode to a PHP array. I tried everything what i found on the internet, but it always throw errors.


If i tried to convert into XML object like this



$xml_object = new SimpleXMLElement($xml);


then i got an error: String could not be parsed as XML


I tried with DOMDocument, but it returns an empty object:



$xml_object = new DOMDocument();
$xml_object->load($xml);


Here is the XML: http://ift.tt/1Hev70k


No comments:

Post a Comment