Hi,
I want to start embedding macros in my webpages. Right now, my php script gets an article text string from MySQL and simply "echo"s it. I often want to put images in these articles, so I just write in the relevant html code as I 'm writing the article. BUT this is a bit cumbrsome, and I would like a much simpler way of doing this, using macros.
I want my script to take the string, look for my macro(s) (only one kind... for now), delimited by [[ and ]], get the string defined within those delimiters, break it up piece by piece, feed those pieces into a function, and finally use the output of that function to replace the entire macro before echoing the string.
For example, [[x|y|z]] would need to be found within a string, passed to a function, macro($x,$y,$z), and the output of macro() would replace [[x|y|z]].
Is there some simple way of doing this, or is it going to be as messy as I think it is?
Thanks!