PHP code example of truecastdesign / spamless

1. Go to this page and download the library: Download truecastdesign/spamless library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

truecastdesign / spamless example snippets


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