根据IP获取所在地区
2010-09-16 13:36:43 by 【6yang】,
117
visits,
收藏 |
返回
<?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;
}
$iipp=get_ip_place();
echo "ip:".$iipp[0]."<br/>";
echo "所在地:".$iipp[2]."<br/>";
?>
share