Hey everyone, I'm working on a PHP application that needs to parse a .tpl file with HTML in it and I'm making it so that the HTML can have variables and basic if statements in it. An if statement look something like this: `
<!--if({VERSION} == 2)-->
Hello World
<!--endif -->
To parse that, I've tried using preg_replace
with no luck. The pattern that I tried was
/<!--if\(([^\]*)\)-->([^<]*)<!--endif-->/e
which gets replaced with
if($1) { echo "$2"; }
Any ideas as to why this won't work and what I can do to get it up and running?