Forum Moderators: coopster
Merry Christmas
in our template system, we use, as all others do, some markers which while compilation of code for user get replaced by their values. for example
<title>#TITLE#</title>
while php parser would parse that html content to prepare its output for user. our code will replace #TITLE# with the value of title it got from the db, right no problem with that.
Now, we want to be able to make a marker like string that works like a function for example would like to have a marker like this
#CATEGORY[Sports]#
#LIST[Cars]#
just need a simple algo using preg_match or anything that would do this
input: #CATEGORY[Sports]#
output: function=CATEGORY
parameter=Sports
input: #LIST[Cars]#
output: function=LIST
parameter=Cars
someone could assist me in writting regular expression for that? please note that only the format of input would be pre-known. Name of the function and parameter cant be hard coded.
Please leme know if there is something that needs explanation
Ciao