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