I\'m including a file in one of my class methods, and in that file has html + php code. I return a string in that code. I explicitly wrote {{newsletter}} and th
{{newsletter}}
This is a code i'm using for templating, should do the trick
if (preg_match_all("/{{(.*?)}}/", $template, $m)) { foreach ($m[1] as $i => $varname) { $template = str_replace($m[0][$i], sprintf('%s', $varname), $template); } }