在php中检测用户控制的包?

发布于 2024-10-07 20:41:19 字数 59 浏览 0 评论 0原文

我想知道检测用户访问的国家/地区的最佳软件包是什么?

我正在使用 php/mysql..

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

I am using php/mysql..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倾城花音 2024-10-14 20:41:19

我认为没有一个有保证的方法,但有一些选择:

  • 您可以使用 GeoIP
  • 您可以检查< a href="http://www.phptutorial.info/scripts/languages.php" rel="nofollow">HTTP_ACCEPT_LANGUAGE 标头($_SERVER)
  • 使用任何 IP 到国家/地区 数据库

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

中性美 2024-10-14 20:41:19

您可以下载 MaxMind GeoLite Country 数据库,并使用它来查找用户的 IP 以确定他们的 IP国家。

该数据库有付费版本,但我发现免费数据库的准确性已经足够了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文