function html2ubb($str)
{
$str = str_replace("\n",'',$str);
$str = preg_replace("/\]+HREF=\"([^\"]+)\"[^>]*\>(.*?)/i","[url=$1]$2[/url]",$str);
$str = preg_replace("/\]+)\"(.*?)\>(.*?)/i","[color=$2]$4[/color]",$str);
$str = preg_replace("/\]+)\"(.*?)\>(.*?)/i","[face=$2]$4[/face]",$str);
$str = preg_replace("/\]+)\"(.*?)\>(.*?)/i","[size=$2]$4[/size]",$str);
$str = preg_replace("/\]+src=\"([^\"]+)\"[^>]*\>/i","[img]$1[/img]",$str);
$str = preg_replace("/\
$str = preg_replace("/\/i","[$1u]",$str);
$str = preg_replace("/\/i","[$1I]",$str);
$str = preg_replace("/\/i","[$1b]",$str);
$str = preg_replace("/\/i","[$1b]",$str);
$str = preg_replace("/\/i","[$1i]",$str);
$str = preg_replace("/]*?>/i","",$str);
return $str;
}
?>