Home > php教程 > php手册 > 新浪通过IP地址获取当前地理位置(省份,城市等)的接口

新浪通过IP地址获取当前地理位置(省份,城市等)的接口

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:37:27
Original
1676 people have browsed it

新浪通过IP地址获取当前地理位置(省份,城市等)的接口 无 function getIpAddress(){ $ipContent = file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"); $jsonData = explode("=",$ipContent); $jsonAddress = substr($json

新浪通过IP地址获取当前地理位置(省份,城市等)的接口 
	function getIpAddress(){  
		$ipContent   = file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js");  
		$jsonData = explode("=",$ipContent);    
		$jsonAddress = substr($jsonData[1], 0, -1);  
		return $jsonAddress;  
	}  
	$ip_info=json_decode(getIpAddress());	
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template