I'm studying PHP OO and part of my study is in putting together a Class that works a template engine. I've converted the file to a string with file_get_contents and now I want to get a part of that string to generate a LOOP.
{LOOP}
<option value="%SEL-VL%">%SEL-TXT%</option>
{ENDLOOP}
My idea is to use preg_match to get the content that is within {LOOP} and {ENDLOOP} and make substitutions for the variables by repeating the html block that was taken.
I need help creating the REGEX that I will use in preg_macth. Can someone give me this strength?
I accept ideas too ... NOTE: I do not use a ready-made framework or the ready-made template engine available on the internet, as this development is part of my study and practice of PHP OO.
Thank you all.