[PHP]Nestsed function
Slightly Wonky Robob 26 Jun 2008
I'm just messing around with preg_replace again, and I'm wondering... Is it possible to use a function as the replace parameter?
e.g.
This of course doesn't work, but you should hopefully get the idea of what I'm trying to do. My current attempts either use "$1 as a string, rather than a variable, output the function name or just give errors.
Ideas?
Edited by Bob, 26 June 2008 - 21:52.
e.g.
$str = preg_replace ("/\[(.*?)\]/is", tagType("$1") , $str);
This of course doesn't work, but you should hopefully get the idea of what I'm trying to do. My current attempts either use "$1 as a string, rather than a variable, output the function name or just give errors.
Ideas?
Edited by Bob, 26 June 2008 - 21:52.