<?php
/**
* Filter for underline BB Tags
* @access public
* @author Jörg Stöber <hide@address.com>
* @version 0.5.3 ($Id: underline.class.php,v 1.1 2004/03/29 22:45:31 cb_fog Exp $)
*/
class BB_FILTER_underline {
/* Parse a given text after underline BB Tags (BB -> HTML)
* @access public
* @param string $text text to parse
* @return string $text parsed text
*/
function parse($text) {
$text = preg_replace('/\[u](.*)\[\/u\]/miUs', '<u>\1</u>', $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('/<u>(.*)<\/u>/miUs', '[u]\1[/u]', $text);
return $text;
}
}
?>