我使用ipinfo.io对于一些简单的查询,但我有echo $details->org;
它输出“AS15169谷歌公司”一个小问题,但我想只有ISP一部分,所以“谷歌公司”。ipinfo.io filter AS #### out?
示例代码:
<?
function ip_details($ip) {
$json = file_get_contents("http://ipinfo.io/{$ip}");
$details = json_decode($json);
return $details;
}
$details = ip_details($_SERVER['REMOTE_ADDR']);
echo $details->org;
?>
输出示例:http://ipinfo.io/8.8.8.8/org
需要一些帮助,任何人吗?