bbcode ()

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

require './includes/user_init.php';

$str = "Hi, [b]there[/b]. This is [i][u]a test[/u][/i].
echo bbcode ($str);

Posted On: Aug-25-2010 @ 07:00am
Last Updated: Jan-01-1970 @ 07:00am

There is no comment. Why not be the first?

More Comments/Post Your Own

Online Users
There are 133 users online.

Connect with us on Facebook


Subscribe to our newsletter for the latest updates and exciting promotions!