Skip to content

truecastdesign/spamless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spamless - Spam detection class

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

About

Spam detection class

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages