私人领地

stdClass object 数据获取方法

 

 

$data  = stdClass Object ( [code] => 0 [data] => stdClass Object ( [country] => 未分配或者内网IP [country_id] => IANA [area] => [area_id] => -1 [region] => [region_id] => -1 [city] => 内网IP [city_id] => local [county] => 内网IP [county_id] => local [isp] => 内网IP [isp_id] => local [ip] => 0.0.0.0 ) )

 

取出数组值:

$data['country'] = $jsonDecode->data->country;
    $data['province'] = $jsonDecode->data->region;
    $data['city'] = $jsonDecode->data->city;
    $data['isp'] = $jsonDecode->data->isp;

 

posted @ 2017-09-05 17:25  狂奔的蜗牛Snails  阅读(3484)  评论(0编辑  收藏  举报