-3
我试图提取有关访问者的IP地址正确的信息:提取正确的信息
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}")); // or from whatismyipaddress.com
echo $details->city;
,我也可以这样写:
ISP
Organization
City
Region
Country
我可以通过json_decode和的file_get_contents提取此信息代码由我自己(geoip)
但这不是正确的方式来提取此信息(通过使用卷曲),
和只网站,返回正确的信息是http://whatismyipaddress.com/
我试图用geoip的,但我的PHP返回不正确的信息。
可能的重复[如何通过PHP检索访问者的ISP?](http://stackoverflow.com/questions/855967/how-do-i-retrieve-the-visitors-isp-through-php) –
@EmilioGort我问了更多的信息 – etnh123123