Is there any possible way to find the name of the country using IP with scripting language PHP?

被刻印的时光 ゝ 提交于 2019-11-29 05:19:06

Depending on your needs at a budget level and an accuracy level there are a few options:

IPGeo: www.ipgeo.com (Free option)

MaxMind GeoIP:http://www.maxmind.com/ (Free option)

Quova: http://quova.com/ (Paid)

NetAcuity by Digital Element/Envoy: http://www.digital-element.com/ (Paid)

Digital Envoy is the inventor of the IP Intelligence space, has the richest dataset of all the providers, and is considered the industry leader. They offer enterprise level solutions and performance, which may or may not be what you're looking for. If all you're interested in is country level data, then most of these providers should be able to suit your needs (accuracy wise) as finding the country of the IP address is not difficult from a technical standpoint. If your budget is free, then my advice would be to use the data provided by MaxMind.

If down the road, you find yourself in need of more granular geographic data (i.e. city level data), then the accuracy between these providers varies greatly with the upper hand going to MaxMind and Digital Envoy, with Digital Envoy having the best overall solution.

Edit:

In regard to one of the users comments about proxies, this can be an issue. Some networks (such as AOL) route all their data through a proxy. Usually that proxy is located within the same country as the originating connection, so the country level data is as accurate as if the user wasn't using a proxy. Obviously if someone wants to use a proxy outside their country they can, but this is the exception not the rule for general internet traffic. Some providers offer a proxy database, or flag ranges known to be proxies, so that you as the user can choose whether or not to trust it for your purposes.

You can use GeoIP for PHP. Here is another site with simpler reading instructions.

You can use the free and monthly updated IP to Country database.

Read the Friendly Manual at:

http://us3.php.net/manual/en/book.geoip.php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!