title: How do I access nested arrays from a json_decode in PHP?
body: <p>I have spent hours at this and I've read loads of answers here on stackoverflow and none have helped.</p>
  
  <p>All I've been able to do so far is to print <strong>Market Square - Clifden</strong> for this example.</p>
  
  <pre><code>$obj = json_decode($data);
  $obj = $obj[0];
  print $obj-&gt;{'title'};
  </code></pre>
  
  <p>I can't figure out how to access "name" nested inside "image" so I can get <strong>market_square_clifden.jpg</strong>.</p>
  
  <p>I'd be grateful for some pointers.</p>
  
  <pre><code>array(1){
          [0]=&gt;array(12){
              ["_id"]=&gt;array(1){
                  ["$oid"]=&gt;string(24)"51f674e4e4b0066cc8197033"
              }
              ["display"]=&gt;int(1)
              ["title"]=&gt;string(23)"Market Square - Clifden"
              ["class"]=&gt;string(21)"market_square_clifden"
              ["icon"]=&gt;string(16)"camera_small.png"
              ["image"]=&gt;array(4){
                  ["name"]=&gt;string(25)"market_square_clifden.jpg"
                  ["top"]=&gt;string(16)"7.98958587646484"
                  ["left"]=&gt;string(18)"397.98614501953125"
                  ["maxwidth"]=&gt;string(16)"599.777777671814"
              }
              ["locs"]=&gt;array(2){
                  ["lng"]=&gt;float(-10.022516)
                  ["lat"]=&gt;float(53.488111)
              }
              ["pov"]=&gt;array(3){
                  ["heading"]=&gt;string(17)"-14.1950626239811"
                  ["pitch"]=&gt;string(18)"-6.368221166504443"
                  ["zoom"]=&gt;string(18)"0.8399999999999999"
              }
              ["photo"]=&gt;array(3){
                  ["takenby"]=&gt;string(13)"Robert French"
                  ["sentinby"]=&gt;string(34)"The Lawrence Photograph Collection"
                  ["description"]=&gt;string(263)"Clifden (Irish: An Clochán, meaning 'stepping stones' is a town on the coast of County Galway, Ireland and being Connemara's largest town, it is often referred to as 'the Capital of Connemara'. It is located on the Owenglen River where it flows into Clifden Bay."
              }
              ["date"]=&gt;array(2){
                  ["posted"]=&gt;string(53)"Mon Jul 29 2013 14:53:53 GMT+0100 (GMT Daylight Time)"
                  ["circa"]=&gt;string(9)"1880-1900"
              }
              ["comments"]=&gt;array(1){
                  [0]=&gt;array(2){
                      ["poster"]=&gt;string(0)""
                      ["comment"]=&gt;string(0)""
                  }
              }
              ["tags"]=&gt;array(1){
                  [0]=&gt;array(2){
                      ["name"]=&gt;string(0)""
                      ["slug"]=&gt;string(0)""
                  }
              }
          }
      }
  </code></pre>