title: php dynamic replacement with a std object
body: <p>How can I make a dynamic replacement with a std object?
  I can't get how to use $1 in this case :(
  See below.</p>
  <pre><code>$lang-&gt;custom_name = &quot;Me&quot;;
  $lang-&gt;custom_email = &quot;Me@me&quot;;
  
  $html = &quot;hello {{custom_name}} with  {{custom_email}} &quot;;    
  
  $html = preg_replace(&quot;/{{(custom_.*)}}/&quot;, $lang-&gt;{'$1'} , $html);
  </code></pre>