FahadKhan
FahadKhan

Reputation: 71

Access object with in array

Array
(
[0] => Contact Object
    (
[id] => 1
[status] => ACTIVE
[first_name] => Ahmed
[middle_name] => 
[last_name] => Taibah
[confirmed] => 
[source] => 
[email_addresses] => Array
(
[0] => EmailAddress Object
(
[id] => 1
[status] => ACTIVE
[confirm_status] => NO_CONFIRMATION_REQUIRED
[opt_in_source] => ACTION_BY_OWNER
[opt_in_date] => 2009-07-23T05:54:30.315Z
[opt_out_date] => 
[email_address] => [email protected]
)
)

How can i get the value of [confirm_status] as this is under object then array then again object then this index value i need.

Upvotes: 2

Views: 57

Answers (3)

som
som

Reputation: 4656

$contact[0]->email_addresses[0]->confirm_status

You can do something like this.

Upvotes: 1

Sonu Sindhu
Sonu Sindhu

Reputation: 1792

You can use this like

$confirm_status = $arr['email_addresses'][0]->confirm_status;

Upvotes: 0

Paweł Zegardło
Paweł Zegardło

Reputation: 396

$arr[0]->email_addresses[0]->confirm_status

Upvotes: 5

Related Questions