// Parse bbcode into HTML code function parseubb($text) { $text = preg_replace('#\[b\](.*?)\[/b\]#si', '\1', $text); $text = preg_replace('#\[i\](.*?)\[/i\]#si', '\1', $text); $text = preg_replace('#\[u\](.*?)\[/u\]#si', '\1', $text); $text = preg_replace('#\[center\](.*?)\[/center\]#si', '
\1
', $text); $text = preg_replace('#\[url\]([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\";\+]*?)([\r\n]*)\[/url\]#si', '\2\3', $text); $text = preg_replace('#\[url\]([\r\n]*)([^\s\'\";\+]*?)([\r\n]*)\[/url\]#si', '\2', $text); $text = preg_replace('#\[url=([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\";\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '\4', $text); $text = preg_replace('#\[url=([\r\n]*)([^\s\'\";\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '\3', $text);