PHP code example of pecee / spam-validator

1. Go to this page and download the library: Download pecee/spam-validator 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/ */

    

pecee / spam-validator example snippets


$comment = $_POST['comment'];
$service = new \Pecee\Service\SpamChecker();

if($service->isSpam($comment)) {
    // Comment contains spam
} else {
    // Continue...
}

$service = new \Pecee\Service\SpamChecker();
$this->service->setPathToSpamList('/path/to/spamlist.txt');