See the preg_replace() for some good examples as to how arrays can be used flexibly.For additional PHP programming examples, see this page for a somewhat advanced generic class for word filtering that *'s out the center letters from censored words, and this previous Stack Overflow question that also has a PHP example (the main valuable part in there is the SQL-based filtered word approach -- the leet-speak compensator can be dispensed with if you find it unnecessary).
There is both a reason and a distinct need for profanity filters (see Wikipedia entry here), but they often fall short of being 100% accurate for very distinct reasons; Context and accuracy.Imagining yourself as a new user (for the 100th time)… Summoning words, any words, to fill that blank page AND move your user from brand-new or free trial to happy customer.I can help by: Need to increase your conversions in your emails?Now's the time to test and refine your emails so they work harder. And frankly, you’ve got a zillion other things you need to focus on.Got new software that needs an onboarding or free trial sequence to support it? You ain't got time for wading through piles of data……But carving out time from the million plus things already on your plate just ain’t looking promising.
And you don’t have the expertise or education needed to make these emails the work-horses they need to be.
I once tried to set up a Google Group for the course I was giving called "Sanal ortamda görselleştirme" which is turkish for "Visualization in virtual media".
Google was stupid enough to reject it because the title contained the word "anal".
Obscenity Filters: Bad Idea, or Incredibly Intercoursing Bad Idea?
Also, one can't forget The Untold History of Toontown's Speed Chat, where even using a "safe-word whitelist" resulted in a 14 year old quickly circumventing it with: Bottom line: Ultimately, for any system that you implement, there is absolutely no substitute for human review (whether peer or otherwise). You also asked where you can get profanity lists to get you started -- one open-source project to check out is Dansguardian -- check out the source code for their default profanity lists.
Wins are super fun, but learning is more important.