I'm making a simple templating system in php.
If I have a variable called $var, I want [var] to be replaced with the value of $var. But I want it to work with anything in square brackets. Could anyone give me a Preg_Replace for this?
Althought NOT a solution, you might want to start with:
http://ca.php.net/manual/en/function.preg-replace.php
And then read:
http://www.regular-expressions.info/
Have fun