This works for me:
status;
if ($status=="OK") {
$Lat = $xml->result->geometry->location->lat;
$Lon = $xml->result->geometry->location->lng;
$LatLng = "$Lat,$Lon";
}
?>
References:
- http://www.fcsoftware.co.uk/blog/?p=66
- https://developers.google.com/maps/documentation/geocoding