Hi
I am integrating with an third party API. After connecting to the endpoint, I use this PHP:
$properties = get_object_vars( $response );
print_r( $properties );
This gives me the following object:
Array
(
[APIResult] => stdClass Object
(
[valid_email] => 1
[person] => stdClass Object
(
[id] => 12365
[firstname] => My
[lastname] => Name
[email_address] => myemail@domain.com
)
[home] => stdClass Object
(
[address_1] =>
[address_2] =>
[address_3] =>
[county_code] =>
[post_code] =>
[telephone] =>
)
[gender] => M
)
)
Now what I need is to know in PHP how I can access the values of that object. Take this scenario:
Step 1) Check if [valid_email] is true and if so..
Step 2) echo to the screen "Welcome back [firstname] [lastname]"
I have tried to get the value as below but this returns nothing:
echo $properties->APIResult->valid_email;
What is the correct way to do this?
Thanks in advance.
Doug