【发布时间】:2020-11-10 04:49:02
【问题描述】:
以下代码用于从 IP 地址获取纬度/经度,但它不提供邮政编码。
$str_arr_ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $_SERVER['REMOTE_ADDR']));
if(!empty($str_arr_ipdat)) {
$str_latitude = $str_arr_ipdat->geoplugin_latitude;
$str_longitude = $str_arr_ipdat->geoplugin_longitude;
}
那么有没有其他免费/付费服务可以让我从 IP 地址或纬度/经度获取邮政编码?我在这里提到了许多类似的问题,但它们太旧了,而且一些服务链接现在已经失效了。
此外,这项免费/付费服务从 IP 地址或纬度/经度获取邮政编码的准确性如何?
请指教,谢谢
【问题讨论】:
标签: php geolocation