I´m a total clueless newbie when it comes to parsing in PHP so any help is greatly appreciated.
What I would like to do is the following:
Say I have a string that looks like this:
$string = "Hello and welcome to my teststring! [showlogo] I hope you will enjoy your stay here. [anotheraction]"
This string could ofcourse look in many ways but all strings will contain one or several words in [ ] or someother char to mark them. I´m trying to make some code that will go thru this string and replace everything withinit with results from different types of functions, for instance [showlogo] would call the showlogo() function which would return an image code.
Then lastly I want to echo the string with the edits, or echo each part before or after the [ ] action with the actions results in between.
So for instance my example string would send the following to a visitors browser:
Hello and welcome to my teststring! <URL-TO-LOGO> I hope you will enjoy your stay here. <RESULT-FROM-ANOTHER-ACTION>
Any ideas on how to do this ?
Thanks in advance,
Joel