package for detecting users contry in php? [closed]

寵の児 提交于 2019-11-27 04:52:17

问题


I want to know what is the best package to detect country which user is visiting from?

I am using php/mysql..


回答1:


I think there is not a guaranteed way but there are some options:

  • You can use GeoIP
  • You can check the HTTP_ACCEPT_LANGUAGE header($_SERVER)
  • Use any IP-To-Country database



回答2:


You can download the MaxMind GeoLite Country database, and use that to lookup the IP of user to determine their country.

There are paid versions of that database, but I've found the accuracy of the free database more than sufficient.



来源:https://stackoverflow.com/questions/4457920/package-for-detecting-users-contry-in-php

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