Categories
PHP

PHP BBcode to HTML parser

Just another class to convert from a BBcode to HTML.

It has all the BBcode basics and also converts youtube video. It’s developed to be compatible with the nice WYSIWYG JQuery BBcode SCEditor

Usage:

if ($_POST)
{
	include 'bbcode.php';

	//parses posted BBcode to HTML
	$html_code	= bbcode::tohtml($_POST['description'],TRUE);

	//removes the bbcode
	$nobbcode	= bbcode::remove($_POST['description']);
}

Download the class here with a full example.