Originally posted by peppino
either one, but i think i need some stuff on my server in order to use bbcode right? i want it to be secure to so those are the only tags allowed
no you dont need anything on your server except php
$preg = array(
// Font and text manipulation ( [color] [size] [font] [align] )
'/\[color=(.*?)(?::\w+)?\](.*?)\[\/color(?::\w+)?\]/si' => "<font color=\"\\1\">\\2</font>",
'/\[color=(.*?)(?::\w+)?\](.*)$/si' => "<font color=\"\\1\">\\2</font>",
'/\[b(?::\w+)?\](.*?)\[\/b(?::\w+)?\]/si' => "<b>\\1</b>",
'/\[b\](.*)$/si' => "<b>\\1</b>",
'/\[i(?::\w+)?\](.*?)\[\/i(?::\w+)?\]/si' => "<i>\\1</i>",
'/\[i\](.*)$/si' => "<i>\\1</i>",
'/\[u(?::\w+)?\](.*?)\[\/u(?::\w+)?\]/si' => "<u>\\1</u>",
'/\[u\](.*)$/si' => "<u>\\1</u>",
'/<ol(.*?)>(?:.*?)<li(.*?)>/si' => "<ol\\1><li\\2>",
'/<ul(.*?)>(?:.*?)<li(.*?)>/si' => "<ul\\1><li\\2>",
);
$text = preg_replace(array_keys($preg), array_values($preg), $text);