title: Parsing JSON data with PHP
body: <p>This is a bit of a noob question.  I'm working with a JSON file which looks something like this:</p>
  
  <pre><code>{"nodes": 
    [{"node": 
       {"Vocabulary name":"Bestseller Format",
        "Term":"Hardcover Fiction",
        "Bestseller1":"9780470227800",
        "Bestseller2":"9781451617962",
        "Bestseller3":"9781439167397",
        "Bestseller4":"9781617750106",
        "Bestseller5":"9780385533300",
        "Bestseller6":"9780670022526",
        "Bestseller7":"9781609530358",
        "Bestseller8":"9780132358040",
        "Bestseller9":"9780596159771",
        "Bestseller10":"9780151014163",
        "Bestseller11":"9780393334807",
        "Bestseller12":"9780805090161"}
    }]
  }
  </code></pre>
  
  <p>And I am trying to parse it in php.  I have come up with a script
  <code></p>
  
  <pre><code>&lt;?php       
    $jsonurl = "http://www.xtracrunchy.com/pandpnewlook/?q=pandp/bestsellers";
    $json = file_get_contents($jsonurl,NULL, NULL, 0, 1000);
    $json_output = json_decode($json,true);
  
    $bestseller_array = $json_output[nodes][0][node];
  
    foreach ($bestseller_array as $key =&gt; $value)
    {
       print $key;
       print " - ";
       print $value;
       print "&lt;br /&gt;";
     }
  
  ?&gt;
  </code></pre>
  
  <p></code></p>
  
  <p>I would like to be able to eventually build an ordered list of Bestseller ISBN's but the only output I get when I run this script is </p>
  
  <p>Vocabulary name - Bestseller Format
  Term - Hardcover Fiction</p>
  
  <p>and when I add print count($bestseller_array); I only get 2 elements in the array.</p>
  
  <p>Any help would be appreciated.</p>