BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / www-technology / #10686同步于 2010/8/16
该镜像源已超过 30 天没有更新,可能在源站已被删除。
WWWTechnology机器人发帖

求助:想通过IP得到所在的城市?求实现思路。(使用PHP)

xsxtxt
2010/8/16镜像同步12 回复
如题
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
xw2423机器人#1 · 2010/8/16
下载ip库匹配。。。 【 在 xsxtxt (xsxtxt) 的大作中提到: 】 : 如题
xsxtxt机器人#2 · 2010/8/16
【 在 xw2423 的大作中提到: 】 : 下载ip库匹配。。。 : 【 在 xsxtxt (xsxtxt) 的大作中提到: 】 : : 如题 : ................... 请问一下比较好的数据库是哪些~
xw2423机器人#3 · 2010/8/16
纯真?你可以google下吧,挺多解决方法额 【 在 xsxtxt (xsxtxt) 的大作中提到: 】 : 请问一下比较好的数据库是哪些~
BookMoth机器人#4 · 2010/8/17
<?php echo file_get_contents('http://ip138.com/ips.asp?ip=218.249.91.198&action=2'); ?>
xw2423机器人#5 · 2010/8/17
这个要有api就好了 【 在 BookMoth (书中蠹鱼) 的大作中提到: 】 : <?php : echo file_get_contents('http://ip138.com/ips.asp?ip=218.249.91.198&action=2'); : ?> : ...................
d15313313395机器人#6 · 2010/8/17
<?php /** * 获取ip地址 *@param string $ip 要查询的IP地址 IPV4 点分十进制 如119.112.63.25 *@param string $format 格式化输出 enum: xml,json(default),plain *@return IP 所在城市和所属网络运营商 */ function getIP($ip,$format) { $url = "http://ip2loc.appspot.com/q/?ip={$ip}&alt={$format}"; return file_get_contents($url); } //如 /* $ip=$_SERVER["REMOTE_ADDR"]; $ipinfo=getIP($ip,'json'); $ipinfo = json_decode($ipinfo,1)+array('ip'=>$ip); print_r($ipinfo); */ //输出 /* Array ( [c] => 北京市 [a] => 电信 [ip] => 60.247.119.202 ) */ ?>
app机器人#7 · 2010/8/17
恩,下载IP库匹配,IP分配本来就是离散的
zzcc机器人#8 · 2010/8/18
http://www.youdao.com/smartresult-xml/search.s?type=ip&q=118.229.135.0
wks机器人#9 · 2010/8/24
本公司有人在做这个ip库。欢迎楼主加入。