我已将以下已解码的 json 存储在$response = $result->response;
:
object(stdClass)#6 (5) {
["EmailAddress"]=> string(18) "[email protected] /cdn-cgi/l/email-protection"
["Name"]=> string(0) ""
["Date"]=> string(19) "2011-10-09 19:32:00"
["State"]=> string(6) "Active"
["CustomFields"]=> array(1) {
[0]=>object(stdClass)#7 (2) {
["Key"]=>string(2) "id"
["Value"]=>string(6) "Dl9lIz"
}
}
我已经可以通过以下方式访问主要属性(电子邮件地址、名称等):
$email = $response->{'EmailAddress'};
print $email;
但我需要访问"Value"
CustomFields 对象中的部分。我不知道如何挖那么深。我正在尝试用 PHP 来做到这一点..
有什么建议么?
它包含在第一个元素 ([0]
) 的数组CustomFields
,因此您可以使用对象运算符访问它(->
) 在数组索引之后。
print $response->CustomFields[0]->Value;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)