PHP Classes

Curse Filter: Replace text with profanity words looking up MySQL

Recommend this page to a friend!
  Info   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 613 This week: 1All time: 5,123 This week: 560Up
Version License PHP version Categories
curse-filter 1.0.0GNU General Publi...5.0PHP 5, Databases, Text processing
Description 

Author

This class can replace text with profanity words looking up a MySQL database.

It can process a text string by looking up its words in a MySQL database table which has profanity words.

The class can replace the found profane words with alternative non-profane words also retrieved from the MySQL database.

Alternatively it can replace the words with asterisks or grawlix symbol characters.

The class also provides means to add, retrieve, update or delete words from the profanity MySQL database table.

Innovation Award
PHP Programming Innovation award nominee
June 2011
Number 4
Using profane words is inappropriate for many sites. In some forums and other types of sites on which the users can freely submit their posts, it may happen that some users use profane words in the posts.

One solution to prevent that happens is to refuse posts with profane words. Another alternative is to accept all posts, but censor any profane words in a way that they do not look profane.

This class provides a clever implementation of that solution. It can lookup a MySQL database of known profane words and replace any words in the database by non-profane equivalent words, or even obfuscate the profane words by replacing some of their letters or even replace them by special symbols.

Manuel Lemos
Picture of James Wilson
Name: James Wilson <contact>
Classes: 1 package by
Country: United States United States
Age: 37
All time rank: 3020414 in United States United States
Week rank: 416 Up46 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file curse-filter.class.php Class Main class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:613
This week:1
All time:5,123
This week:560Up