rendered paste bodyfunction bb2html($str){ $str = htmlspecialchars($str, ENT_NOQUOTES); $find = array('#\[ ?b *\](.+)\[ ?/b *\]#isU', '#\[ ?i *\](.+)\[ ?/i *\]#isU', '#\[ ?u *\](.+)\[ ?/u *\]#isU', '#\[ ?s *\](.+)\[ ?/s *\]#isU', '#\[(colou*r)=([a-z0-9]*)\](.*)\[\/\1\]#isU', '#\[ ?quote *\](.+)\[ ?/quote *\]#isU', '#\[ ?list *\](.+)\[ ?/list *\]#isU', '#\[ ?\* *\](.+)#isU', '#\[(size)=([0-9]*)\](.*)\[\/\1\]#isU', '#\[(quote)=([a-z0-9]*)\](.*)\[\/\1\]#isU', '#\[ ?code *\](.+)\[ ?/code *\]#isU', '#\[ ?img *\](.+)\[ ?/img *\]#isU', '/^.*\[url=(https?:\/\/)([^\]]*)\].*\[\/url\].*$/', '/^.*\[url=([^\]]*)\].*\[\/url\].*$/'); $replace = array('<b>\1</b>', '<i>\1</i>', '<u>\1</u>', '<s>\1</s>', '<span style="color: \2">\3</span>', '<table width="100%" bgcolor="lightgray"><tr><td bgcolor="white">\1</td></tr></table>', '<ul>\1</ul>', '<li>\1', '<span style="font-size: \2">\3</span>', '<table style=padding-left:30px cellspacing="1" cellpadding="3" width="100%" border="0" align="center"><tr><td><b>\2 wrote:</b></td></tr><tr><td bgcolor="#E7E7F2"><br />\3<br /></td></tr></table></$ 'Code:<table style=padding-left:30px width="100%"><tr><td bgcolor="white"><code>\1</code></td></tr></table>', '<img src="\1" />', '<a href="\1\2">\3</a>', '<a href="http://\2">\3</a>',);