龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

php 通过IP获取地理位置

时间:2014-10-08 02:11来源:网络整理 作者:网络 点击:
分享到:
通过IP获取地理位置 [代码片段(10行)]
function get_ip_place()
{
    $ip=file_get_contents("<a href="http://fw.qq.com/ipaddress">http://fw.qq.com/ipaddress");
    $ip=str_replace('"',' ',$ip);
    $ip2=explode("(",$ip);
    $a=substr($ip2[1],0,-2);
    $b=explode(",",$a);
    return $b;
}
//该片段来自于http://outofmemory.cn
精彩图集

赞助商链接