2
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.

2
  • That would be something like foreach ($array as $key => $value) echo $value['confirm_status']; Commented Jul 4, 2013 at 10:25
  • I would disagree on that.. the usage of this should become: $value[0]->confirm_status .. u r looping only 1 time. so U get $value to hold the values of the 1st Contact Object.. either edit or remove Commented Jul 4, 2013 at 10:28

3 Answers 3

5
$arr[0]->email_addresses[0]->confirm_status
Sign up to request clarification or add additional context in comments.

Comments

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

You can do something like this.

1 Comment

it's the same as comment up
0

You can use this like

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.