I'm trying to access the xml data from http://ratings.food.gov.uk/OpenDataFiles/FHRS523en-GB.xml but can't seem to retrieve it correctly. I don't think it has anything to do with the structure of the data however. How can I retrieve and display the data?
<?php
$fhrsid = 'FHRSID';
$LocalAuthorityBusinessID = 'LocalAuthorityBusinessID';
$xml = simplexml_load_file("http://ratings.food.gov.uk/OpenDataFiles/FHRS523en-GB.xml");
echo "<h2>".$xml->getName()."</h2><br />";
foreach($xml->children() as $data)
{
echo "FHRSID: ".$data->$fhrsid."<br />";
echo "LocalAuthorityBusinessID : ".$data->$LocalAuthorityBusinessID." <br />";
echo "BusinessName : ".$data->BusinessName." <br />";
echo "BusinessType : ".$data->BusinessType." <br />";
echo "BusinessTypeID : ".$data->BusinessTypeID." <br />";
echo "AddressLine1 : ".$data->AddressLine1." <br />";
echo "AddressLine2 : ".$data->AddressLine2." <br />";
echo "<hr/>";
}
?>