从lat和long获取邮政编码


Get a postcode from lat and long

我有一个lat和long,我想通过http请求将它们发送到谷歌地图之类的地方,并检索英国的邮政编码。

这可能吗?

$json=file_get_contents("http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=manchester+uk");

$json=json_decode($json);

$json是一个数组;因此,您可以访问http://maps.googleapis.com/maps/api/geocode/json?sensor=false&地址=曼彻斯特+英国

如果你需要查找lat和lng,你可以用以下内容替换url:http://maps.googleapis.com/maps/api/geocode/json?latlng=53.39990299999999,-230009690&传感器=错误