function getCoordinates($address){
$address = str_replace(” “, “+”, $address); // replace all the white space with “+” sign to match with google search pattern
$url = “http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address”;
$response = file_get_contents($url);
$json = json_decode($response,TRUE); //generate array object from the response from the web
return ($json[‘results’][0][‘geometry’][‘location’]);
}
WordPress is the leading web factor. In case you need help read the from our experts.
Feb 21, 2016
Get Geo Coordinates Of An Address
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment