(.*?)\<\/b\>/is',
                        '/\(.*?)\<\/i\>/is',
                        '/\(.*?)\<\/u\>/is',
                        '/\(.*?)\<\/ul\>/is',
                        '/\- (.*?)\<\/li\>/is',
                        '/\\") /is',
                        '/\ /is',
                        '/\(.*?)\<\/div\>/is',
                        '/\ /is',
                        '/\ (.*?)\<\/strong\>/is',
                        '/\(.*?)\<\/a\>/is',
			'/\(.*?)\<\/code\>/is',
			'/\(.*?)\<\/span\>/is',
			'/\(.*?)\<\/blockquote\>/is',
                        );
// Replace with
$bbtags = array(
						'',
                        '[b]$1[/b]',
                        '[i]$1[/i]',
                        '[u]$1[/u]',
                        '[list]$1[/list]',
                        '[*]$1',
                        '[img]$2[/img]',
                        '$2',
                        "\n",
                        '[b]$1[/b]',
                        '[url=$1]$3[/url]',
			'[code]$1[/code]',
			'[color="$1"]$2[/color]',
			'[quote]$1[/quote]',
                        );
// Replace $htmltags in $text with $bbtags
$text = preg_replace ($htmltags, $bbtags, $s);
// Strip all other HTML tags
$text = strip_tags($text);
return $text;
}