二月飞

学学更健康

2013年8月17日

多维数组特殊字符的转义函数

摘要: 1 function _addslashes($arr){ 2 foreach($arr as $k=>$v){ 3 if(is_string($v)){ 4 $arr[$k]=addslashes($v); 5 }elseif(is_array($v)){ 6 $arr[$k]=_addslashes($arr); 7 } 8 } 9 return $arr;10 }这个函数可以用来将多维数组中的特殊字符进行转义输出 阅读全文

posted @ 2013-08-17 20:04 二月飞 阅读(250) 评论(0) 推荐(0) 编辑

如何检测文件中的违禁词和小于规定大小的文件?

摘要: 1 "; 9 unlink($file);10 continue;}11 $con=file_get_contents($file);12 if(stripos($con,'fuck')!==false){13 14 echo $v."文章中有违禁词,删除"."";15 unlink($file);16 continue;17 }18 echo $v."符合规定,被留下来了!";19 }20 ?> 阅读全文

posted @ 2013-08-17 10:00 二月飞 阅读(221) 评论(0) 推荐(0) 编辑

导航