title: echo an element from 2nd dimension array php
body: <p>I am trying to echo a single element from an array stored in the cell of the parent array.  For the sake of readability, we'll call the parent array $parent and the child array $child.  I want to echo the 2nd element from $child.  When I use the code:</p>
  
  <pre><code>echo "$parent[0][1]";
  </code></pre>
  
  <p>I get the array to string conversion error followed by the text "[1]".  As I understand it, "$parent[0]" should be interpreted as $child, so that the following [1] would request the second element from $child.  Clearly, this is not happening, and the only part that is being read is $parent[0] which is then thrown back because that element is an array.</p>
  
  <p>Also, my $parent array is populated by a looped function which pulls data from a table, so it's simpler to leave its elements in numeric form.  In specific, each element of $parent holds the id# and date of a round of golf, retrieved from a table full of rounds of golf.  My function pulls them using mysql_query and looped mysql_get_row when then stores in my $parent array.</p>
  
  <p>I realize there's a lot of unnecessary information here, but I'm hoping it helps avoid solutions that are unworkable in my specific situation.  My basic question is, how to echo an element from an array nested within another array.</p>
  
  <p>Thanks in advance.</p>
  
  <p><em>Edit after answer</em></p>
  
  <p>The below answers work perfectly, but I also found a dirty workaround.  Assigning the $child array to a placeholder and then printing from the placeholder works, but it requires a few more lines of code and doesn't look pretty.</p>
  
  <p>eg.</p>
  
  <pre><code>$holdArray = $parent[0];
  echo "$holdArray[1]";
  </code></pre>
  
  <p>Thanks again for the quick and helpful responses.  As always the SE community comes through.</p>