首页 » 交流学习 » PHP5 » 阅读文章

Get IP Address & Browser Area

2011-07-15 16:44 149 0 发表评论
标签:

利用QQ检测ip及地区,为我所用

$ip=@file_get_contents(‘http://fw.qq.com/ipaddress’,false);
$ip=str_replace(‘”‘,’ ‘,$ip);
$ip2=explode(‘(‘,$ip);
$a=str_replace(‘ ‘, ”,substr($ip2[1],0,-2));
$b=explode(‘,’,$a);
print_r($b);

/************************** result ***************************************/

Array
(
[0] => 202.104.151.87
[1] =>
[2] => 广东省

    [3] => 深圳市
)

评论 0条 (RSS 2.0) 发表

  1. 暂无评论,快抢沙发吧。

发表评论 (我不会回答任何技术性问题,如果你不会使用,请选择其他主题。)

  • 

联系我 Contact Me

回到页首