title: PHP JSON decode - stdClass
body: <p>I was having a question about making a <a href="https://stackoverflow.com/questions/4078422/php-merge-arrays-into-2d-json">2D JSON string</a></p>
  
  <p>Now I would like to know why I can't access the following:</p>
  
  <pre><code>$json_str = '{"urls":["http://example.com/001.jpg","http://example.com/003.jpg","http://example.com/002.jpg"],"alts":["testing int chars àèéìòóù stop","second description",""],"favs":["true", "false", "false"]}';
  
  $j_string_decoded = json_decode($json_str);
  // echo print_r($j_string_decoded); // OK
  
  // test get url from second item
  echo j_string_decoded['urls'][1];
  // Fatal error: Cannot use object of type stdClass as array
  </code></pre>