Possible duplicate:
How do you implement a good profanity filter?
I have an iPhone application that passes a string through the URL of my php script, which then inserts into my database. I would like to write some php code that reads $ body for any predefined irregularity.
Right now, I only have the following code, but it is only looking for exact matches, and not if $ body contains, then .. the type of sequence. In addition, I need him to replace the oath with an empty "", deleting everything together.
if($body == "swear word")
return;
source
share