2012年1月4日 没有评论

ս΄Ěȝ

分类: 七不相的 标签: ,

CSS代码收集

2011年12月21日 没有评论

1、用CSS来控制图片显示的最大宽度
下面是CSS控制图片显示的最大宽度的代码,直接放在CSS文件中调用就可以了

1
2
3
4
#test img {
  max-width:300px;/*IE7和Firefox用*/
  width: expression(this.width > 300 ? 300: true); /*IE6用*/
}
分类: CSS 标签:

PHP正则过滤html标签

2011年12月21日 没有评论

$content=preg_replace(“/\s+/”, ” “, $content); //过滤多余回车

$content=preg_replace(“/<[ ]+/si","<",$content); //过滤<__("<"号后面带空格)

$content=preg_replace("/<\!--.*?-->/si”,”",$content); //注释

$content=preg_replace(“/<(\!.*?)>/si”,”",$content); //过滤DOCTYPE

$content=preg_replace(“/<(\/?html.*?)>/si”,”",$content); //过滤html标签

$content=preg_replace(“/<(\/?head.*?)>/si”,”",$content); //过滤head标签

$content=preg_replace(“/<(\/?meta.*?)>/si”,”",$content); //过滤meta标签

$content=preg_replace(“/<(\/?body.*?)>/si”,”",$content); //过滤body标签

$content=preg_replace(“/<(\/?link.*?)>/si”,”",$content); //过滤link标签

$content=preg_replace(“/<(\/?form.*?)>/si”,”",$content); //过滤form标签

$content=preg_replace(“/cookie/si”,”COOKIE”,$content); //过滤COOKIE标签

$content=preg_replace(“/<(applet.*?)>(.*?)<(\/applet.*?)>/si”,”",$content); //过滤applet标签
$content=preg_replace(“/<(\/?applet.*?)>/si”,”",$content); //过滤applet标签

$content=preg_replace(“/<(style.*?)>(.*?)<(\/style.*?)>/si”,”",$content); //过滤style标签
$content=preg_replace(“/<(\/?style.*?)>/si”,”",$content); //过滤style标签
$content=preg_replace(“/<(title.*?)>(.*?)<(\/title.*?)>/si”,”",$content); //过滤title标签

$content=preg_replace(“/<(\/?title.*?)>/si”,”",$content); //过滤title标签
$content=preg_replace(“/<(object.*?)>(.*?)<(\/object.*?)>/si”,”",$content); //过滤object标签
$content=preg_replace(“/<(\/?objec.*?)>/si”,”",$content); //过滤object标签

$content=preg_replace(“/<(noframes.*?)>(.*?)<(\/noframes.*?)>/si”,”",$content); //过滤noframes标签
$content=preg_replace(“/<(\/?noframes.*?)>/si”,”",$content); //过滤noframes标签
$content=preg_replace(“/<(i?frame.*?)>(.*?)<(\/i?frame.*?)>/si”,”",$content); //过滤frame标签
$content=preg_replace(“/<(\/?i?frame.*?)>/si”,”",$content); //过滤frame标签

$content=preg_replace(“/<(script.*?)>(.*?)<(\/script.*?)>/si”,”",$content); //过滤script标签
$content=preg_replace(“/<(\/?script.*?)>/si”,”",$content); //过滤script标签
$content=preg_replace(“/javascript/si”,”Javascript”,$content); //过滤script标签
$content=preg_replace(“/vbscript/si”,”Vbscript”,$content); //过滤script标签

分类: PHP 标签: ,