以下2010年的腾讯ip地址库接口, 现在腾讯已关闭ip地址库api接口, 老修有mysql版本地址库出售, ip地址查询可访问: http://www.lao8.org/chk_ip.php
偶尔在网上看到的,虽然写的不是太理想,还可以用,做过记号,以后抽空改进一下。
<?php
function get_ip_place(){
$ip=file_get_contents("http://fw.qq.com/ipaddress");
$ip=str_replace('"',' ',$ip);
$ip2=explode("(",$ip);
$a=substr($ip2[1],0,-2);
$b=explode(",",$a);
return $b;
}
$ip=get_ip_place();
print_r($ip);
?>
function get_ip_place(){
$ip=file_get_contents("http://fw.qq.com/ipaddress");
$ip=str_replace('"',' ',$ip);
$ip2=explode("(",$ip);
$a=substr($ip2[1],0,-2);
$b=explode(",",$a);
return $b;
}
$ip=get_ip_place();
print_r($ip);
?>