truecastdesign/spamless

此库为传入内容提供垃圾邮件过滤和保护。

v1.1.2 2020-08-18 23:03 UTC

This package is auto-updated.

Last update: 2024-09-06 03:54:01 UTC


README

版本:v1.1.2

安装

使用 composer 安装

composer require truecastdesign/spamless

需要 PHP 7.1 或更高版本。

用法

以下是一个基本的用法示例

# composer autoloader
require '/path/to/vendor/autoload.php';

$Spam = new Truecast\Spamless(['name'=>'My Name', 'message'=>'This is a message', 'phone'=>'This value is not checked']);

# 'check' should be passed the value keys you want to check
# 'with' should be passed the tests to proform
# 'basic' check values for too many consonants in a row, spammy keywords, and gibberish.
# 'url' checks values for urls
# 'html' check values for html

if ($Spam->tests(['gibberish','uppercase','underscores','keywords','russian','url','html'])->check(['name','phone', 'message'])) {
	echo 'valid';
else
	echo 'not valid: ';
print_r($Spam->errors());