Select Page
This entry has been published on 2013-02-26 and may be out of date.

Last Updated on 2013-02-26.

<?
$address = utf8_encode('1030 wien'); //Use this function to avoid problems with special characters, like German 'Umlaute'

$response = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($address) . '&amp;sensor=true');

$response = json_decode($response);

echo 'Latitude:' . $response-&gt;results[0]-&gt;geometry-&gt;location-&gt;lat;
echo 'Longitude:' . $response-&gt;results[0]-&gt;geometry-&gt;location-&gt;lng;
?>