예제 #1
0
function get_city($ip = null)
{
    $cities = option_category('city', false, true);
    $ip = $ip ? $ip : Utility::GetRemoteIP();
    $location = ip_location_youdao($ip);
    if ($location) {
        foreach ($cities as $one) {
            if (FALSE !== strpos($location, $one['name'])) {
                return $one;
            }
        }
    }
    return array();
}
예제 #2
0
 public function test()
 {
     $ip = get_client_ip();
     dump(ip_location_youdao($ip));
 }