You'll want to read the var dump types to determine how to access the data structure. If it says object
(e.g., in your dump it first lists object(stdClass)#13
), then you'll use ->
operator to access the listed elements (e.g., $object->contact
). If it says array
, you can use index notation [0]
or, if more than one element, iterate with a loop construct:
foreach ($object->contact as $contact) {
foreach ($contact->fields as $field) {
if ($field->type == 'name') {
echo $field->value->givenName, ' ', echo $field->value->middleName;
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…