开发者

package for detecting users contry in php? [closed]

开发者 https://www.devze.com 2023-01-30 16:14 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago. 开发者_Python百科

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

I am using php/mysql..


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号