Hallo Razor,
zu ersetzen: "~[PHP](.*?)[/PHP]~i"
dir könnte der e-modifier helfen - damit wird bei preg_replace im ersetzen-Teil auch php geparst (siehe auch http://de2.php.net/pcre.pattern.modifiers und das 4.Beispiel auf http://de2.php.net/function.preg-replace). Das könnte dann etwas so aussehen (ungetestet):
$text = preg_replace("~[PHP](.*?)[/PHP]~ei","highlight_string($1)",$text);
Grüße aus Nürnberg
Tobias
--
Selfcode: sh:( fo:) ch:? rl:( br:< n4:& ie:% mo:| va:) de:] zu:) fl:( ss:| ls:[ js:|
Selfcode: sh:( fo:) ch:? rl:( br:< n4:& ie:% mo:| va:) de:] zu:) fl:( ss:| ls:[ js:|