-1

Trying to print records from result received from JSON. Below is the format of JSON result

I am getting in $result = json_decode($result,true);

Array
(
    [title] => API Directory
    [description] => This directory contains links for Product Feed API and Delta Feed API of all categories with all the versions available
    [apiGroups] => Array
        (
            [affiliate] => Array
                (
                    [name] => affiliate
                    [apiListings] => Array
                        (
                            [food_nutrition] => Array
                                (
                                    [availableVariants] => Array
                                        (
                                            [v0.1.0] => Array
                                                (
                                                    [resourceName] => food_nutrition
                                                    [get] => 
                                                    [deltaGet] => 
                                                    [top] => 
                                                    [post] => 
                                                    [put] => 
                                                    [delete] => 
                                                )

                                            [v1.1.0] => Array
                                                (
                                                    [resourceName] => food_nutrition
                                                    [get] => 
                                                    [deltaGet] => 
                                                    [top] => 
                                                    [post] => 
                                                    [put] => 
                                                    [delete] => 
                                                )

                                        )

                                    [apiName] => food_nutrition
                                )
                        )

                )

        )

)

I wanted to print [resourceName] and [get] from [v1.1.0] => Array How can I get this done? Please advice.

Dave
  • 3,073
  • 7
  • 20
  • 33
Vijay G
  • 63
  • 9
  • Something like `echo $result['apiGroups']['affiliate']['apiListings']['food_nutrition']['availableVariants']['v1.1.0']['resourceName']`? – bzeaman Aug 22 '16 at 13:37

1 Answers1

0
echo $result['apiGroups']['affiliate']['apiListings']['food_nutrition']['availableVariants']['v1.1.0']['resourceName'];
echo $result['apiGroups']['affiliate']['apiListings']['food_nutrition']['availableVariants']['v1.1.0']['get'];

Not very pretty but something like that anyway, it's a multidimensional array afterall.

Professor Abronsius
  • 33,063
  • 5
  • 32
  • 46