Login   Register  
PHP Classes
elePHPant
Icontem

Curse Filter: Replace text with profanity words looking up MySQL

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2011-06-09 (3 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 550 This week: 2All time: 5,025 This week: 936Up
Version License PHP version Categories  
curse-filter 1.0GNU General Public Lice...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: 28
All time rank: 2837362 in United States United States
Week rank: 820 Up88 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:550All time:5,025
 This week:2This week:936Up