Get country location of an IP with native PHP

前端 未结 8 1059
野性不改
野性不改 2020-12-23 16:46

Read on before you say this is a duplicate, it\'s not. (as far as I could see)

I want to get the county code in php from the client.

Yes I know you can do th

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-23 17:13

    Here's a few:

    • http://api.hostip.info/get_html.php?ip=174.31.162.48&position=true
    • http://geoiplookup.net/geoapi.php?output=json&ipaddress=174.31.162.48
    • http://ip-api.com/json/174.31.162.48?callback=yourfunction
    • http://ipinfo.io/174.31.162.48

    All return slightly different results.

提交回复
热议问题