title: How can I access this nested array within my JSON object?
body: <p>I'm using PHP to return a json_encode()'d array for use in my Javascript code. It's being returned as:</p>
  
  <pre><code>{"parent1[]":["child1","child2","child2"],"parent2[]":["child1"]}
  </code></pre>
  
  <p>By using the following code, I am able to access <code>parent2 &gt; child1</code></p>
  
  <pre><code>$.getJSON('myfile.php', function(data)
  {
     for (var key in data)
     {
        alert(data[key]);
     }
  }
  </code></pre>
  
  <p>However, this doesn't give me access to <code>child1, child2, child</code>, of <code>parent1</code>. Alerting the key by itself shows 'parent1' but when I try to alert it's contents, I get undefined.</p>
  
  <p>I figured it would give me an object/array? How do I access the children of parent1?</p>
  
  <p>data[key][0] ?</p>