tags:

views:

27

answers:

1

I have the array variable say $value, and it has the below given array

[navigation] => navigationHistory Object
        (
            [path] => Array
                (
                    [0] => Array
                        (
                            [page] => order_form.php
                            [mode] => NONSSL
                            [get] => Array
                                (
                                    [id] => 31
                                )
                        )
                )
        )

how to echo/access the 'get' index of the given array in PHP syntax

+3  A: 

Considering $value is an array and $value['navigation'] is an object:

echo $value['navigation']->path[0]['get']['id'];

That is, only if navigationHistory::$path is public.

If not, see the class definition for navigationHistory to see if it doesn't have a getter for the field path.

Andrew Moore