易截截图软件、单文件、免安装、纯绿色、仅160KB

php常用的正则过滤


$str=preg_replace("/\s+/", " ", $str); //过滤多余回车   
$str=preg_replace("/<[ ]+/si","<",$str); //过滤<__("<"号后面带空格)   
  
$str=preg_replace("/<\!--.*?-->/si","",$str); //注释   
$str=preg_replace("/<(\!.*?)>/si","",$str); //过滤DOCTYPE   
$str=preg_replace("/<(\/?html.*?)>/si","",$str); //过滤html标签   
$str=preg_replace("/<(\/?head.*?)>/si","",$str); //过滤head标签   
$str=preg_replace("/<(\/?meta.*?)>/si","",$str); //过滤meta标签   
$str=preg_replace("/<(\/?body.*?)>/si","",$str); //过滤body标签   
$str=preg_replace("/<(\/?link.*?)>/si","",$str); //过滤link标签   
$str=preg_replace("/<(\/?form.*?)>/si","",$str); //过滤form标签   
$str=preg_replace("/cookie/si","COOKIE",$str); //过滤COOKIE标签   
  
$str=preg_replace("/<(applet.*?)>(.*?)<(\/applet.*?)>/si","",$str); //过滤applet标签   
$str=preg_replace("/<(\/?applet.*?)>/si","",$str); //过滤applet标签   
  
$str=preg_replace("/<(style.*?)>(.*?)<(\/style.*?)>/si","",$str); //过滤style标签   
$str=preg_replace("/<(\/?style.*?)>/si","",$str); //过滤style标签   
  
$str=preg_replace("/<(title.*?)>(.*?)<(\/title.*?)>/si","",$str); //过滤title标签   
$str=preg_replace("/<(\/?title.*?)>/si","",$str); //过滤title标签   
  
$str=preg_replace("/<(object.*?)>(.*?)<(\/object.*?)>/si","",$str); //过滤object标签   
$str=preg_replace("/<(\/?objec.*?)>/si","",$str); //过滤object标签   
  
$str=preg_replace("/<(noframes.*?)>(.*?)<(\/noframes.*?)>/si","",$str); //过滤noframes标签   
$str=preg_replace("/<(\/?noframes.*?)>/si","",$str); //过滤noframes标签   


相关文档:

PHP中多维数组的排序

1.用户定义排序:usort($array, functionName);其中functionName为用户定义的函数名,用户定义的函数指定排序规则,比较数组中两个元素的大小,大于返回正数,小于返回负数,等于返回0。2.反向用户排序:用户定义函数时,比较数组中两个元素的大小,大于返回负数,小于返回正数,等于返回0。$fruits = array(array('APP', ' ......

php字符串比较用==的一个教训

一直认为php中字字符串比较直接用==来判断还是很方便的,但今天遇到的一个问题,彻底让我明白了使用strcmp的必要性.这个问题很多老手都可能会忽略的.
今天在登录自己做的程序时,在输入验证码后,想直接按小键盘上回车登录(程序检查了回车事件),结果按回车按成了键盘上回车键旁边小数的那个键,验证码栏就多输入了一个点。由于 ......

php实现当前用户在线人数

原理:根据不同的IP统计出当前有多少人在线。
实现方式:可以用数据库,也可以用文本。
我这里用了文本实现。
<?php
/**
*@ Date         2010.04.07
*@ Author       华夏之星 PHP100.com
*@ Blog      & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号