Location: PHPKode > projects > Content*Builder > contentbuilder/lib/bb_filters/bold.class.php
<?php
/**
 * Filter for bold BB Tags
 * @access public 
 * @author Jörg Stöber <hide@address.com> 
 * @version 0.5.3 ($Id: bold.class.php,v 1.1 2004/03/29 22:45:31 cb_fog Exp $)
 */
class BB_FILTER_bold {
	/* Parse a given text after bold BB Tags
	* @access public
	* @param string $text text to parse
	* @return string $text parsed text
	*/
	function parse($text) {
		$text = preg_replace('/\[b](.*)\[\/b\]/miUs', '<b>\1</b>', $text);
		return $text;
	}
	
	/* Reverse the parsing process (HTML -> BB)
	* @access public
	* @param string $text text to parse
	* @return string $text parsed text
	*/
	function parseReverse($text) {
		$text = preg_replace('/<b>(.*)<\/b>/miUs', '[b]\1[/b]', $text);
		return $text;
	}
}
?>
Return current item: Content*Builder