I am using this code for finding the lat lon of a location
$api=\'http://maps.googleapis.com/maps/api/geocode/json?address=United States Neversink&sensor
Use urlencode to encode the address part. (The problem is the space in the address.)
$address = urlencode("United States Neversink"); $api='http://maps.googleapis.com/maps/api/geocode/json?address=$address&sensor=false'; $result = file_get_contents($api);