php
$str=preg_replace("/\s+/", " ", $str); //过滤多余回车
$str=preg_replace("/过滤/si","",$str); //过滤html标签
$str=preg_replace("//si","",$str); //过滤form标签
$str=preg_replace("/cookie/si","COOKIE",$str); //过滤COOKIE标签
$str=preg_replace...>/si","",$str); //过滤script标签
$str=preg_replace("/javascript/si","Javascript",$str); //过滤script标签
$str...\\1=",$str); //过滤script标签
$str=preg_replace("//si","&#",$str); //过滤script标签,
$str = preg_replace(