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”);

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

Leave a comment

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