title: PHP Api Json array?
body: <p>How do you retrieve keys from a array such as this?
  Im very confused. </p>
  
  <pre><code>&lt;?php
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, "http://completion.amazon.com/search/complete?search-alias=aps&amp;client=amazon-search-ui&amp;mkt=1&amp;q=facebook");
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  $result = curl_exec($curl);
  curl_close($curl);
  print_r(json_decode($result));//return amazone autocomplete suggestion
  </code></pre>
  
  <p><strong>RESULT:</strong></p>
  
  <pre><code>Array ( [0] =&gt; facebook [1] =&gt; Array ( [0] =&gt; facebook [1] =&gt; facebook messenger [2] =&gt; facebook app [3] =&gt; facebook.com [4] =&gt; facebook login welcome to facebook [5] =&gt; facebook gift card [6] =&gt; facebook log in [7] =&gt; facebook for dummies [8] =&gt; facebook marketing [9] =&gt; facebook messenger for blackberry 10 ) [2] =&gt; Array ( [0] =&gt; stdClass Object ( [nodes] =&gt; Array ( [0] =&gt; stdClass Object ( [name] =&gt; Apps &amp; Games [alias] =&gt; mobile-apps ) [1] =&gt; stdClass Object ( [name] =&gt; Gift Cards [alias] =&gt; gift-cards ) [2] =&gt; stdClass Object ( [name] =&gt; Books [alias] =&gt; stripbooks ) ) ) [1] =&gt; stdClass Object ( ) [2] =&gt; stdClass Object ( ) [3] =&gt; stdClass Object ( ) [4] =&gt; stdClass Object ( ) [5] =&gt; stdClass Object ( ) [6] =&gt; stdClass Object ( ) [7] =&gt; stdClass Object ( ) [8] =&gt; stdClass Object ( ) [9] =&gt; stdClass Object ( ) ) [3] =&gt; Array ( ) )
  </code></pre>