title: PHP: Access parent key within nested foreach
body: <p>EDIT*************</p>
  
  <p>There was no issue with my loop, turns out I just had one of those tricky "Quotation mark' errors. I'd like to blame it on Monday morning but well, that was just dumb haha. Well I guess here's an example of what works lol:</p>
  
  <p>What I'm doing is this:</p>
  
  <pre><code>$array = [
    0 =&gt; [
      0 =&gt; 1,
      1 =&gt; 3
    ],
    1 =&gt; [
      0 =&gt; 5,
      1 =&gt; 4
    ]
  ]
  
  foreach($array as $key=&gt;$value){
    foreach($value as $_key=&gt;$_value){
      echo "Parent key: " . $key . " Child value: " . $_value; 
    }
  }
  </code></pre>
  
  <p>This works great. <em>palm in face</em></p>