Ok, I know how to replace some text. But lets say I have a string like so:
This is some text %replacement%
%%%TMPL_START%%%
This is a repeating block %i%
%%%TMPL_END%%%
This is the footer to some file %replacement%
What I want to do is use the string as a template. Replacing text such as %i% is easy.
But say %i% is an array. How can I repeat that block (from the TMPL_START to TMPL_END) for sizeof($i).
Boy that's hard to explain. Ultimately, I'm looking to implement some sort of looping mechanism to my script's templating feature. So that i can repeat a block of text in the template as necessary.
It's an interesting proposal, but I'm not sure how to go about it. Thanks.