title: PHP: high depth array, how do return current key name?
body: <p>I have a huge array from a json_decode result (assoc set to true) and have the following code to check if (one of the arrays within, a random serial) has the key 'set_true'</p>
  
  <pre><code>$out = "";
  foreach ($array as $sub) {
    //$out[] = $sub['set_true'];
    if (in_array($sub['set_true'], $sub) &amp;&amp; $sub['set_true'] == '1' ) {
       $out[] = 'User: ' . $sub . ' has set_true = 1';
    }
  }
  </code></pre>
  
  <p>That code lists all the users with that array key set to 1, but $sub returns 'array' and not the current key I'm on! (the random serial)</p>
  
  <p>How do I return it? </p>