4 function html2bbcode($s) {
10 '/\<b\>(.*?)\<\/b\>/is',
11 '/\<i\>(.*?)\<\/i\>/is',
12 '/\<u\>(.*?)\<\/u\>/is',
13 '/\<ul\>(.*?)\<\/ul\>/is',
14 '/\<li\>(.*?)\<\/li\>/is',
15 '/\<img(.*?) src=\"(.*?)\" (.*?)\>/is',
16 '/\<div(.*?)\>(.*?)\<\/div\>/is',
18 '/\<strong\>(.*?)\<\/strong\>/is',
19 '/\<a href=\"(.*?)\"(.*?)\>(.*?)\<\/a\>/is',
20 '/\<code\>(.*?)\<\/code\>/is',
21 '/\<span style=\"color:(.*?)\"\>(.*?)\<\/span\>/is',
22 '/\<blockquote\>(.*?)\<\/blockquote\>/is',
40 '[color="$1"]$2[/color]',
44 // Replace $htmltags in $text with $bbtags
45 $text = preg_replace ($htmltags, $bbtags, $s);
47 // Strip all other HTML tags
48 $text = strip_tags($text);