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;

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM