rendered paste body<?phpfunction parse_bbcode($text, $xhtml = true){ $tags = array( '#\[b\](.*?)\[/b\]#si', '#\[i\](.*?)\[/i\]#si', '#\[u\](.*?)\[/u\]#si', '#\[s\](.*?)\[/s\]#si', '#\[color=(.*?)\](.*?)\[/color\]#si', '#\[img\](.*?)\[/img\]#si', '#\[url=(.*?)\](.*?)\[/url\]#si', '#\[email\](.*?)\[/email\]#si', '#\[code\](.*?)\[/code\]#si', '#\[align=(.*?)\](.*?)\[/align\]#si', '#\[br\]#si', ); $return = array( ($xhtml ? '<strong>\\1</strong>' : '<b>\\1</b>'), ($xhtml ? '<em>\\1</em>' : '<i>\\1</i>'), ($xhtml ? '<span style="text-decoration: underline;">\\1</span>' : '<u>\\1</u>'), ($xhtml ? '<strike>\\1</strike>' : '<s>\\1</s>'), ($xhtml ? '<span style="color: \\1;">\\2</span>' : '<font color="\\1">\\2</font>'), ($xhtml ? '<img src="\\1" border="0" alt="" />' : '<img src="\\1" border="0" alt="">'), '<a href="\\1" title="\\2">\\2</a>', '<a href="mailto:\\1" title="Email \\1">\\1</a>', '<code>\\1</code>', ($xhtml ? '<div style="text-align: \\1;">\\2</div>' : '<div align="\\1">\\2</div>'), ($xhtml ? '<br style="clear: both;" />' : '<br>'), }; $text = preg_replace($tags, $return, $text); return $text;}?>