Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rndoom04/spamdetector
Spam detector library for php7.0+
https://github.com/rndoom04/spamdetector
Last synced: 11 days ago
JSON representation
Spam detector library for php7.0+
- Host: GitHub
- URL: https://github.com/rndoom04/spamdetector
- Owner: Rndoom04
- License: mit
- Created: 2022-02-16T09:27:47.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-19T18:12:34.000Z (over 2 years ago)
- Last Synced: 2024-11-13T00:17:42.219Z (2 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SpamDetector
=============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);
```