Several sites out there "borrow" ideas from othe more successful projects when they're developing their own - and one of the features that I see over and over in other applications is the "BB code" borrowed from the Ultimate Bulletin Board project. Now, for all of those out there that want a simple way to integrate it into your code, check out this new article from SitePoint for all of the details.
From Use BB Code in Your PHP Application: Many Websites allow visitors or administrators to contribute to the sites's content through various mans: a Content Management System, forums, blogs, or other commenting systems. When you're building such sites, it's a good idea to provide users with the ability to enhance that content by posting formatted text.
[...] This series of articles will provide you with everything you need to start: Using the so-called BB code to format Website content and Coloring code of virtually any programming language used in your content. In this, part one of the guide, you'll learn how to use BB code in your PHP application.
They start off with a simple "what is it?" on what BB code is, how it works, and what kind of benefits it can have for you and your site. They opt to go with the PEAR route, using a library already developed (HTML_BBCodeParser) to grab the text to format and parse it into a finished result. With a simple initialization and parse command, just about any text can be simply and easily transformed from BB coded to modified HTML in a blink of an eye. They also cover some of the configuration options for the PEAR module, setting it to allow only certain tags while ignoring others (like anchor tags). And, of course, what would a good system be without the ability to expand upon the tags already in place, crating a system of custom tags...




