$ch = curl_init('http://tool.huixiang360.com/zhanzhang/ipaddress.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$a = curl_exec($ch);
preg_match('/\[(.*)\]/', $a, $ip);
echo '您现在的IP是: ' , $ip[1] , "\n";
PHP通过调用接口获取当前网关IP地址,从而获取当前地理位置信息
猜你喜欢
转载自blog.csdn.net/weixin_42799222/article/details/89916458
今日推荐
周排行