title: Get Array value by string of keys
body: <p>I'm building a template engine for my next project, which is going great. It replaces <code>{tag}</code> with a corresponding value. </p>
  
  <p>I want <code>{tag[0][key]}</code> to be replaced as well. All I need to know is how to get the value, if I have the string representation of the array and key, like this:</p>
  
  <pre><code>$arr = array(
      0 =&gt; array(
          'key' =&gt; 'value'
      ),
      1 =&gt; array(
          'key' =&gt; 'value2'
      )
  );
  
  $tag = 'arr[0][key]';
  
  echo($$tag);
  </code></pre>
  
  <p>This is a very simple version of the problem, I hope you understand it. Or else I would be happy to answer any questions about it.</p>