$str=preg_replace("/<s*imgs+[^>]*?srcs*=s*('|")(.*?)\1[^>]*?/?s*>/i","", $str);
$str=preg_replace("/s+/","", $str);
$str=preg_replace("/<[ ]+/si","<",$str);
$str=preg_replace("/<!--.*?-->/si","",$str);
$str=preg_replace("/<(!.*?)>/si","",$str);
$str=preg_replace("/<(/?html.*?)>/si","",$str);
$str=preg_replace("/<(/?head.*?)>/si","",$str);
$str=preg_replace("/<(/?meta.*?)>/si","",$str);
$str=preg_replace("/<(/?body.*?)>/si","",$str);
$str=preg_replace("/<(/?link.*?)>/si","",$str);
$str=preg_replace("/<(/?form.*?)>/si","",$str);
$str=preg_replace("/cookie/si","COOKIE",$str);
$str=preg_replace("/<(applet.*?)>(.*?)<(/applet.*?)>/si","",$str);
$str=preg_replace("/<(/?applet.*?)>/si","",$str);
$str=preg_replace("/<(style.*?)>(.*?)<(/style.*?)>/si","",$str);
$str=preg_replace("/<(/?style.*?)>/si","",$str);
$str=preg_replace("/<(title.*?)>(.*?)<(/title.*?)>/si","",$str);
$str=preg_replace("/<(/?title.*?)>/si","",$str);
$str=preg_replace("/<(object.*?)>(.*?)<(/object.*?)>/si","",$str);
$str=preg_replace("/<(/?objec.*?)>/si","",$str);
$str=preg_replace("/<(noframes.*?)>(.*?)<(/noframes.*?)>/si","",$str);
$str=preg_replace("/<(/?noframes.*?)>/si","",$str);
$str=preg_replace("/<(i?frame.*?)>(.*?)<(/i?frame.*?)>/si","",$str);
$str=preg_replace("/<(/?i?frame.*?)>/si","",$str);
$str=preg_replace("/<(script.*?)>(.*?)<(/script.*?)>/si","",$str);
$str=preg_replace("/<(/?script.*?)>/si","",$str);
$str=preg_replace("/javascript/si","Javascript",$str);
$str=preg_replace("/vbscript/si","Vbscript",$str);
$str=preg_replace("/on([a-z]+)s*=/si","On\1=",$str);
$str=preg_replace("/&#/si","&#",$str);
</s*imgs+[^>