如何在 AB_ID 中检索 ID 和 Name?我不想在 foreach 中循环,因为总会有一个结果,而且似乎没有必要。(除非这是唯一的方法)。
这是PHP。
print_r($response); // gives data below. truncated.
QueryResult Object
(
[queryLocator] =>
[done] => 1
[records] => Array
(
[0] => stdClass Object
(
[Account_Name] => business_name
[Account] => account_no
[AB] => 12344567
[AB_more] => stdClass Object
(
[Id] => 123445
[Name] => Test 3
)
我目前在做什么:
foreach($response as $key => $val) { $name = $val->Account_Name; #returns 业务名称 $account = $val->账户;#returns account_no $ab = $val->AB; #返回 12344567 // 下面似乎没有任何效果 $ab_id = $val->AB_more->Id $ab_id = $val->AB_more.Id $ab_id = $val->AB_more[0]->Id
谢谢!