$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;