Maison > Article > développement back-end > php调用google地图
php调用googlemap?
php 调用googlemap,并根据客户端发送的经纬度显示位置,怎样实现?
function curIp(){<br /> $ip='';<br /> if(getenv('HTTP_CLIENT_IP') and strcasecmp(getenv('HTTP_CLIENT_IP'),'unknown')){<br /> $ip=getenv('HTTP_CLIENT_IP');<br /> }elseif(getenv('HTTP_X_FORWARDED_FOR') and strcasecmp(getenv('HTTP_X_FORWARDED_FOR'),'unknown')){<br /> $ip=getenv('HTTP_X_FORWARDED_FOR');<br /> }elseif(getenv('REMOTE_ADDR') and strcasecmp(getenv('REMOTE_ADDR'),'unknown')){<br /> $ip=getenv('REMOTE_ADDR');<br /> }elseif(isset($_SERVER['REMOTE_ADDR']) and $_SERVER['REMOTE_ADDR'] and strcasecmp($_SERVER['REMOTE_ADDR'],'unknown')){<br /> $ip=$_SERVER['REMOTE_ADDR'];<br /> }else{<br /> $ip='127.0.0.1';<br /> }<br /> return $ip;<br />}