Thanks a lot, but do you know how to do the same with ereg_replace? I'm trying to learn PCRE, but until I do, I won't be able to add anything to this...

function bbcode($text){
$text = ereg_replace("(\\[i\\])([^\\[]+)(\\[/i\\])",'<i>\\2</i>',$text);
return $text;
print bbcode('[i]This[/i] is a [i]test[/i].');


Kyle Gibson

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to