$se=$_GET["ip"];
$tempu=parse_url($se);
if($tempu['host'])
{
$se=$tempu['host'];
}
$ip = gethostbyname($se);
$json=file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=".$ip);
$obj = json_decode($json);
$addr=$obj->country."-".$obj->province."-".$obj->city;
echo $addr;
网友评论