i have a text saved in variable and part of that var has [CCODE] in it. that CCODE should split the text between CCODE tags in variable and use the php function highlight_string on it..
here is how i wanted to do that:
but it just doesn't work..PHP Code:$patterns = array();
$replacements = array();
// code [ccode] to color code (highlight_string()<img src="images/smilies/wink.gif" border="0" alt="">
$patterns[0] = "#[CCODE](.*?)[/CCODE]#si";
$replacements[0] = "<hr>". highlight_string(\1) ."<hr>";
$text = "
blah blah blah
[CCODE]
<html>
<head></head>
<body>
</body>
</html>
[/CCODE]
weasel
";
$text = preg_replace($patterns, $replacements, $text);
echo $text;
can someone please help me with that? please, please,..
thank you very much all :P





Bookmarks