@NogDogDec 11.2007 — #Besides the fact that the logic is flawed, since you cannot store a variable within a string and have that variable somehow magically replaced in your function, it is generally best to avoid the use of global variables in functions due the way they closely couple the function to the rest of the code, plus can lead to maintenance nightmares down the road. It is better to pass all external values as function parameters, e.g.: [code=php] function example($text, $search, $replace) { echo str_replace($search, $replace, $text); } $text = "Here is a [[fruit]]."; example($text, '[[fruit]]', 'banana'); [/code]