Country name from php

前端 未结 6 2571
一向
一向 2020-12-03 15:39

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?

6条回答
  •  离开以前
    2020-12-03 16:28

    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

    example post: http://api.hostip.info/get_html.php?ip=12.215.42.19

    example response: Country: UNITED STATES (US) City: Sugar Grove, IL

提交回复
热议问题