gpt4 book ai didi

php - 使用数组访问对象

转载 作者:行者123 更新时间:2023-12-03 03:58:20 25 4
gpt4 key购买 nike

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] => info@test.sa
)
)

我如何获取[confirm_status]的值,因为它位于对象下,然后是数组,然后是对象,然后是我需要的索引值。

最佳答案

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

关于php - 使用数组访问对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17467829/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com