please answer

Dani AI

Generated

Short answer: No - BBCode is not HTML. It’s a lightweight, forum-focused markup that uses square-bracket tags; the forum software parses those tags and emits HTML (usually sanitized) for the browser. That point echoes , and ’s example shows the basic idea of mapping BBCode tags to HTML, but implementations vary.

Key differences: BBCode has no DTD or single standard and is intentionally smaller and safer than full HTML. Different forum engines support different tag sets and behaviors (formatting, links, images, quotes, code blocks, etc.). Many boards store the raw BBCode in the database and render HTML when pages are displayed; some provide client-side previews or cache the rendered HTML to speed delivery.

Practical tips: if a tag “doesn’t work,” check the board’s help/FAQ for the allowed tags and make sure tags are properly closed and nested. Avoid mixing raw HTML on boards that strip it. For developers: don’t rely on naive regex replacements for real-world parsing of nested tags — use a tokenizer or an established BBCode library that handles nesting and outputs sanitized HTML. Always whitelist allowed tags and URL schemes, HTML-escape user text outside permitted conversions, and provide a dedicated code/pre area so users can show raw BBCode without it being parsed.

Bottom line: BBCode is a convenience/safety layer layered above HTML and converted by forum software. ’s one-liner illustrates a quick hack but is fragile for nested or complex markup, and ’s “BBhtml” description is misleading. Consult the specific forum’s docs for the exact syntax and supported tags.

Recommended Answers

All 5 Replies

No, but it is a variation on it.
For example, [ b ]this text is bold![ / b ] is the same as <b>this text is bold</b> in html.

Note that I've put spaces in the bbcode so as it's not picked up.

BBcode is interpreted and rendered into HTML by PHP.

bb code is not html, it you wrote it in PHP it might look something like this:

$message = preg_replace("#\[b\](.*?)\[/b\]#","<b>\\1</b>",$message);

it's not pretty if you don't know much about regular expressions. Granted there are other ways of doing this, but this is a nice one-liner

BBhtml code is a simple implementation of Html code, it quiclkly allows you to change the basic style of your text.

That is not correct. BBCode is NOT an "implementation of HTML". That would require that it have it's own DTD or schema, doctype, etc. It isn't particularly simple, either, as it relies on PHP Regular Expressions. While powerful, regex isn't simple!

BBCode is short for "Bulletin Board Code", and is a tool developed, in PHP, and adopted by most if not all forum software vendors.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.