前台需要 getCity() 直接获取来源地址 以及网络
if ( ! function_exists('getCity'))
{
function getCity()
{
static $a_country;
$iiip=GetIP();
$taobao = 'http://ip.taobao.com/service/getIpInfo.php?ip=';
$url = $taobao.$iiip;
$json = file_get_contents($url);
$json = json_decode($json, true);
$a_country=$json['data']['country'].$json['data']['area'].$json['data']['region'].$json['data']['city']." ".$json['data']['isp'];
return $a_country;
}
}
写进 include/extend.func.php 文件内