使用多个stdClass对象从深度关联数组中提取值

时间:2016-07-22 09:15:42

标签: php associative-array

我试图从极其复杂的关联数组中访问一个值:

stdClass Object
(
    [return] => Array
        (
            [0] => stdClass Object
                (
                    [entries] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [key] => LAUNCH_DATE
                                    [value] => 2016/07/20
                                )

                            [1] => stdClass Object
                                (
                                    [key] => COUNTRIES
                                    [value] => AU
                                )

我试过这个以获得价值' AU'但遗憾的是没有运气:

$test = $array_store->return->entries->1->value;
echo $test;

这非常困难,而且我在挣扎。我设法从一个更简单的数组中提取,但这个数组太深了。请帮忙 - 尝试学习。

1 个答案:

答案 0 :(得分:1)

试试:

{{1}}