PHP的国家/地区名称
问题描述:
如何在不使用商业GeoIP地区版的情况下使用Php从IP地址获取国家/地区名称.请有人帮我吗?
How to get country name from an Ip address using Php with out using a commercial GeoIP Region Edition. Please does any one help me?
答
我不认为您可以简单地使用PHP来做到这一点,但是我找到了可以使用的免费API解决方案.它需要简单的发布和回复. http://www.hostip.info/use.html
I don't think you can do it simply using PHP, but I have found a free API solution that you can use. It requires simple post and response. http://www.hostip.info/use.html
示例帖子: http://api.hostip.info/get_html.php?ip=12.215. 42.19
示例响应: 国家:美国(美国) 城市:伊利诺伊州舒格罗夫
example response: Country: UNITED STATES (US) City: Sugar Grove, IL