truecastdesign/spamless

This library provides spam filtering and protection for in coming content.

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

This package is auto-updated.

Last update: 2024-04-06 02:59:05 UTC


README

Version: v1.1.2

Install

To install with composer:

composer require truecastdesign/spamless

Requires PHP 7.1 or newer.

Usage

Here's a basic usage example:

# 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());