PHP Classes

PHP Spam Check: Check if a text can be spam testing invalid words

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 443 All time: 6,234 This week: 673Up
Version License PHP version Categories
spam-check 1.0GNU Lesser Genera...4.2Algorithms, PHP 5, Text processing, V...
Description 

Author

This class can check if a text can be spam testing invalid words.

It can analyse a given text and check if it contains too many words that look invalid.

The class returns a result that determines if the text can be spam, discarding words that were considered invalid but were whitelisted.

Innovation Award
PHP Programming Innovation award nominee
January 2014
Number 4
Determining if a text message can be spam is hard. However, spam message often have invalid words to workaround spam filters.

This class provides a solution to detect if a text can be spam by analyzing the number of words that seem to be invalid, ignoring words from white lists that should be accepted as valid.

Manuel Lemos
Picture of Roger Baklund
  Performance   Level  
Name: Roger Baklund is available for providing paid consulting. Contact Roger Baklund .
Classes: 7 packages by
Country: Norway Norway
Age: 58
All time rank: 18056 in Norway Norway
Week rank: 193 Up1 in Norway Norway Up
Innovation award
Innovation award
Nominee: 4x

Example

<?php

error_reporting
(E_ALL);
ini_set('display_errors',1);
date_default_timezone_set('Europe/Paris');

include(
'demo_AutoSpamChecker.php');

?><html><head><title>SpamChecker test</title>
</head><body>
<h1>SpamChecker test</h1>
<p>Test form, enter something:</p>
<form method="post" style="float:left;margin:1em;">
<div style="width:15em;border:solid 1px black;padding:1em;background-color:silver;">
<fieldset><textarea rows="8" name="text"></textarea></fieldset>
<fieldset>A:<input type="text" name="a" value="" /></fieldset>
<fieldset>B:<input type="text" name="b" value="" /></fieldset>
<fieldset>C:<input type="text" name="c" value="" /></fieldset>
<fieldset>sessionkey:<input type="text" name="sessionkey" value="HlglRskGghwf" /></fieldset>
<input type="submit" value="Go" />
</div></form>
<?php
if(count($_REQUEST))
  echo
'<h2>Input accepted, spam check report:</h2>'.
   
$SpamChk->GetTextStatus().
   
$SpamChk->VowCon->HTMLReport();
?>
</body>
</html>


Screenshots (2)  
  • screenshot_test_1.png
  • screenshot_test_2.png
  Files folder image Files (7)  
File Role Description
Accessible without login Plain text file demo_AutoSpamChecker.php Example Demo, how to automatically evaluate all input (by including script)
Plain text file SpamChecker.class.php Class Main class
Accessible without login Plain text file SpamChecker_test_1.php Example Demo 1
Accessible without login Plain text file SpamChecker_test_2.php Example Demo 2
Plain text file VowCon.php Class Vowel/consonant analysis

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadspam-check-2014-03-01.zip 181KB
Downloadspam-check-2014-03-01.tar.gz 181KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
VowCon Download .zip .tar.gz For vowel/consonant analysis Required
 Version Control Unique User Downloads Download Rankings  
 0%
Total:443
This week:0
All time:6,234
This week:673Up