首页 » 交流学习 » PHP5 » 阅读文章
Get IP Address & Browser Area
利用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) 发表