php代码
<?php
/**
* 敏感词汇过滤
* User: konakona
* Date: 12-11-28
* Time: 下午4:37
* 调用方式
* if(false === SensitiveFilter::filter($content)){
* error("含有敏感词汇");
* }
*/
class SensitiveFilter extends Think{
public static $wordArr = array();
public static $content = "";
/**
* 处理内容
* @param $content
*
* @return bool
*/
public static function filter($content){
if($content=="") return false;
self::$content = $content;
empty(self::$wordArr)?self::getWord():"";
foreach ( self::$wordArr as $row){
if (false !== strstr(self::$content,$row)) return false;
}
return true;
}
public static function getWord(){
self::$wordArr = include 'SensitiveThesaurus.php';
}
}
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号