I just found the solution!
here is how its done....
<?php
$address=""; //address looking for
$key=""; // google map key that needs to be generate for your site by google maps
$file = file_get_contents("http://maps.google.com/maps/geo?output=xml&q=".
urlencode($address). "&key=".GOOGLE_MAP_KEY);
/**
* A Bug? It says it's utf-8, but it's really not :(
*/
$xml = iconv("ISO-8859-1", "UTF-8", $file);
$xml = simplexml_load_string($xml);
if (!is_object($xml))
throw new Exception("Could not connect to geocode server. Sent argument: $address");
if ($xml->Response->Status->code == 200) {
$coordinates = (string) $xml->Response->Placemark->Point->coordinates;
list($latitude, $longitude) = explode(',', $coordinates);
echo ("lat: $latitude - lon: $longitude");
} else {
throw new Exception("could not find $address");
}
?>