Geocoding with PHP and Google Maps

After changing hosting companies I was having problems with the message:
URL file-access is disabled in the server configuration

In the end the simple solution is to replace:
$xml = simplexml_load_file($request_url) or die(“url not loading”);

with
$ch = curl_init($request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($response);

Leave a Reply

Your email address will not be published. Required fields are marked *