返回归属地 isp 等ip地址信息 指定ip时会显示指定ip的地址信息Array ( [ret] = 1 [start] = 124.128.0.0 [end] = 124.128.255.255 [country] = 中国 [province] = 山东 [city] = 济南 [district] = [isp] = 联通 [type] = [desc] =) 不知道时,会显示运行代码
返回归属地 isp 等ip地址信息
指定ip时会显示指定ip的地址信息Array ( [ret] => 1 [start] => 124.128.0.0 [end] => 124.128.255.255 [country] => 中国 [province] => 山东 [city] => 济南 [district] => [isp] => 联通 [type] => [desc] => )
不知道时,会显示运行代码的服务器ip地址信息 CorePHP
function ip2add($ip=''){ $json = file_get_contents('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip='.$ip); $address = json_decode($json,true); return $address; } print_r(ip2add());//会显示服务器的ip地址信息 print_r(ip2add('124.128.61.235'));//显示指定ip的地址信息
![php中文网最新课程二维码](/static/images/article_wechat2021.jpg?1111)
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论