I'm trying to parse an xml file that contains accents, but I get this error "String could not be parsed as XML". Unfortunately I can't work on the xml file, as it is downloaded from an external source, so I was wondering if there's any easy way to fix it.
Here's my code:
<?php
$requestAddress = "test.xml";
// Gets data
$xml_str = file_get_contents($requestAddress,0);
// Parses XML
$xml = new SimplexmlElement($xml_str);
?>
I have looked all around but I can't see any solution to the problem, or at least I don't understand them! :-)