开发者

Getting the Country,City name from IPAddress in PHP

开发者 https://www.devze.com 2023-01-10 09:18 出处:网络
I would like to get the City name,Country Name from IPAddress. I have used the below URL http://www.ipgp.net/api/xml/220.244.120.73.

I would like to get the City name,Country Name from IPAddress. I have used the below URL http://www.ipgp.net/api/xml/220.244.120.73.

But in the City field, its giving Area name. For eg,when the user is in Sydney,Australia. Its giving as开发者_开发技巧 Mascot,Australia where Mascot is a place in Sydney.


This is usually not possible, because ISPs don't publicize such detailed information. (IP-based Geolocation services work a lot with guesses and hazy algorithms in the first place.) The more exact the geolocation, the more this would also become a privacy problem.

If you need such detailed information, consider the new HTML 5 Geolocation API that allows visitors to disclose location information voluntarily.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号