rndoom04/spamdetector
Composer 安装命令:
composer require rndoom04/spamdetector
包简介
A library detecting spam in forms or other strings. Friendly use with clear PHP, Nette framework, etc..
README 文档
README
PHP test(). Compatible with PHP >= 7.0.
This is a simple library for detect spam from string - good for example contacts forms
Install
For PHP version >= 7.0:
composer require Rndoom04/spamdetector
How to use it
Firstly init the library by simply "use".
use Rndoom04\spamdetector;
Then set load the library and set it how you want.
$spamdetector = new \Rndoom04\spamdetector\detector();
$spamdetector->detectLanguage(true); // Detect language? Default false
$spamdetector->setLanguageWhitelist(["cs", "sk", "en"]); // Only cs (czech language), sk (slovak language) and en (english)
$spamdetector->setTestForbiddenWords(true); // Test on forbidden words? Default true
$spamdetector->setTestUrls(true); // Test on URLs? Default true
Easy! Let's test detecting.
// One test
echo $spamdetector->test("Is this string ok?");
// Variable test
$testString = "Is this next string ok?";
echo $spamdetector->test($testString);
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-16