Reputation: 331
I use the API of my CRM to receive contacts. Now, I want to access the email address of the contact:
$result = $api->findContacts($params);
print_r($result[0]->email);
returns ...
stdClass Object (
[0] => [email protected]
[--primary] => [email protected]
)
How can access the email address stored in [--primary] via PHP? I tried $result[0]->email->--primary etc, but does not work.
Thanks
Upvotes: 1
Views: 2334
Reputation: 7739
Try this :
$primary = '--primary';
echo $result[0]->email->{$primary};
Upvotes: 1