Country name from an Ip address with free IP geolo

2019-03-22 08:59发布

First of all thanks to all ....

I read that i can use the free IP geolocation webservice to get Country name from an Ip address. But how i get the response to my site , Actually this is what i look , In my site there is a need of displaying the country name from Ip address. Can uou please tell in detail... How can i display the country Name from that site ..

3条回答
做自己的国王
2楼-- · 2019-03-22 09:44

Have checked this functionality in Oplim? It is free for up to 500k pageviews, and you can set your code and custom condition (country, or even areas such as all the EU).

enter image description here

Disclosure: I am among the service developers.

查看更多
Deceive 欺骗
3楼-- · 2019-03-22 09:50

http://www.maxmind.com/app/php

You need to install the php module and then use the following code to get the country name:

$country_name = apache_note("GEOIP_COUNTRY_NAME");

查看更多
叛逆
4楼-- · 2019-03-22 09:58

geoip_country_code_by_name can give you the country for an arbitrary IP address or hostname (not just the one from the current visitor as apache_note("GEOIP_COUNTRY_NAME") does), it uses the same MaxMind database. There is also the geoip_country_name_by_name function if you want the full country name rather than the ISO code.

查看更多
登录 后发表回答