Match words in php

Possible duplicate:
How do you implement a good profanity filter?

I need to create a script that removes bad words from a message or username or whatever they send to my site.

I have a small script that already deletes them, but also cuts out good words like: a** , f**k , etc.

now my problem is that I have a script that already removes bad words (from my list) but also removes good

 a** and glass 

I do:

 str_replace('a**', '***', $message); 

I want to make sure that I will not write good words or a name, for example, what is the best solution?

thanks

+4
source share

Source: https://habr.com/ru/post/1386022/


All Articles