我如何到达affiliate_info1对象?谁能帮我吗?
stdClass Object ( [status] => 1 [httpStatus] => 200 [data] => stdClass Object ( [page] => 1 [current] => 1 [count] => 1 [pageCount] => 1 [data] => Array ( [0] => stdClass Object ( [Stat] => stdClass Object ( [affiliate_info1] => riHPLAieOoKkeXMKKiNPiA ) ) [1] => stdClass Object ( [Stat] => stdClass Object ( [affiliate_info1] => XCuAQTtLkWTIKYMWKESlQS ) ) [2] => stdClass Object ( [Stat] => stdClass Object ( [affiliate_info1] => XCuAQTtLkWTIKYMWKESlQS ) ) ) [dbSource] => branddb ) [errors] => Array ( ) [errorMessage] => ) foreach($json as $item){ print_r($item->data); }
答案 0 :(得分:0)
foreach($myObject->data->data as $row){
echo $row->Stat-> affiliate_info1;
}
您可以在data
嵌套数组中进行简单循环,并检索嵌套对象的值。
我想当对象中嵌套数组时,您会感到困惑。