$url = “http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=”.urlencode($resident_address); $lat_long = get_object_vars(json_decode(file_get_contents($url)));// pick out what we need (lat,lng)$lat = $lat_long[‘results’][0]->geometry->location->lat;$lng =$lat_long[‘results’][0]->geometry->location->lng; /*echo $lat;echo $lng;*/