PHP code example of tbetool / spam-doctor

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

    

tbetool / spam-doctor example snippets


$spamDoctor->getSpamItems();

[
   0 => [
     item => 'welcome',
     count => 4
   ]
]

$spamDoctor->getSpamPositions();

[
   0 => 4,
   1 => 12,
   2 => 25
]

$spamDoctor->getHighlighted();

$spamDoctor->getHighlighted(true);

$spamDoctor->getSpamDictionary();

$replace_rule = [
    'o' => 0,
    'O' => 0,
    '*' => '_'
];

$replace_rule = json_encode($replace_rule);

$spamDoctor->setReplaceRule($replace_rule);

$spamDoctor->teachDoctor($json_data);

$spamDoctor = new SpamDoctor();

$spamDoctor->check($text_content);