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