Hi-
I have a template file that has some PHP variables inside of it. I would like to pass through the template and evaluate any variables inside the template file. I have "tags" around the PHP variables.
<<TEMPLATE FILE>>
blah html code
<MARKER>$variable1<REKRAM>
blah html code
I can write PHP code to go line by line through the code to find the "marked" code.
$myLine=preg_replace("/(.*?)<MARKER>(.*?)<REKRAM>(.*?)/","$1$2$3",$myLine);
The above code works fine in removing the "markers" but it does not evaluate the PHP variable.
How do I eval() $2 (the PHP variable)?
Is there an easier way?
-TIA
--Mike Robb
I have a template file that has some PHP variables inside of it. I would like to pass through the template and evaluate any variables inside the template file. I have "tags" around the PHP variables.
<<TEMPLATE FILE>>
blah html code
<MARKER>$variable1<REKRAM>
blah html code
I can write PHP code to go line by line through the code to find the "marked" code.
$myLine=preg_replace("/(.*?)<MARKER>(.*?)<REKRAM>(.*?)/","$1$2$3",$myLine);
The above code works fine in removing the "markers" but it does not evaluate the PHP variable.
How do I eval() $2 (the PHP variable)?
Is there an easier way?
-TIA
--Mike Robb