【问题标题】:Top Level Domain of the Country were the User come from用户来自的国家的顶级域
【发布时间】:2017-10-12 11:56:33
【问题描述】:

我需要一个显示用户国家/地区的 tld 的 php 脚本。 例如,如果用户来自英国,那么我需要输出“uk”,或者如果他是德国人,我需要奥地利的“de”“at”美国的“us”等等。

您可以在wordcreator.org 上观看。应该有用户的国家顶级域名而不是“.de”。在行中分别是“.yourCountry”、“.com”、“.net”、“.org”等。

【问题讨论】:

  • 这正是我需要的,但我需要它没有这个大框架集。 Processwire怎么办?

标签: php geolocation geocoding geo


【解决方案1】:

哇,这么简单!

<?php $location = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$_SERVER['REMOTE_ADDR'])); print_r($location) ?>

安装手册:Here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-07
    • 2011-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多