title: PHP Preg_replace placeholders
body: <p>Hi I'm writing something for handling my views an I need a preg_replace here, but i can't seem to get it working so I've scrapped the code.</p>
  
  <p>the strings I am trying to replace are dynamic based on a template, e.g.</p>
  
  <p><code>{{name}} is {{age}} years old</code></p>
  
  <p>And the passed information into the function is an array e.g.</p>
  
  <p><code>
  array(
    'name' =&gt; 'John Doe',
    'age' =&gt; '27'
  );
  </code></p>
  
  <p>The pattern I have so far is <code>\{{([a-zA-Z0-9]+)\}}</code> however this only seems to match one pair of braces.</p>
  
  <p>I'm also having a problem looping through results in preg_match_all..</p>
  
  <p>Thanks in advance</p>