function bbcode($Text)
Convert any bbcode tags to html tags, eg [b]bold[/b] to <b>bold</b>.
$Text = the bbcode'd string to be converted.
Accepted BB code:
- [p][/p] = equals to <p></p>.
- [b][/b] = bold.
- [i][/i] = italic.
- [u][/u] = underline.
- [s][/s] = strike through
- [o][/o] = overline
- [url]URL[/ul] or [url=URL] = create a hyperlink to URL.
- [email]EMAIL[/email] or [email=EMAIL] = create a hyperlink to send an email to EMAIL.
- [color=COLOR][/color] = text color, COLOR in valid CSS color value.
- [size=SIZE][/size] = set font size to SIZE.
- [list][/list] = create a list.
- [list=1|a|A|i|I][/list] = create a list.
- [*][/*] = equals to <li></li>, useful for [list], eg: [list][*]One[/*][*]Two[/*][/list]
- [font=FONT][/font] = set font family to FONT.
- [code][/code] = wrap the contents in <code> tag.
- [quote][/quote] = wrap the contents in <quote> tag.
- [img]IMAGE[/img] or [img=IMAGE][/img] = display an image.
Example 1
<?php
require './includes/user_init.php';
$str = "Hi, [b]there[/b]. This is [i][u]a test[/u][/i].
[list][*]One[/*][*]Two[/*][/list]";
echo bbcode ($str);
?>