i got a url like this one http://somedomain.com/frieventexport.php
and the content of this url is a plain XML structure if I check out the source-code of the site:
How can I parse this URL and use it in PHP? This script gives me an error… "Error loading XML".
<?php
$xml_url = "http://somedomain.com/frieventexport.php";
if (($response_xml_data = file_get_contents($xml_url))===false){
echo "Error fetching XML\n";
} else {
libxml_use_internal_errors(true);
$data = simplexml_load_string($response_xml_data);
if (!$data) {
echo "Error loading XML\n";
foreach(libxml_get_errors() as $error) {
echo "\t", $error->message;
}
} else {
print_r($data);
}
}
?>