新浪ip物理地址获取

    xiaoxiao2021-11-13  75

      function GetIpLookup($ip) {                 $res = @file_get_contents('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=' . $ip);                 if (empty($res)) {                     return false;                 }                 $jsonMatches = array();                 preg_match('#\{.+?\}#', $res, $jsonMatches);                 if (!isset($jsonMatches[0])) {                     return false;                 }                 $json = json_decode($jsonMatches[0], true);                 if (isset($json['ret']) && $json['ret'] == 1) {                     $json['ip'] = $ip;                     unset($json['ret']);                 } else {                     return false;                 }                 return $json;             }
    转载请注明原文地址: https://ju.6miu.com/read-678244.html

    最新回复(0)