Whats in this post?
- Background and Explanation of the code
To copy code: Click “View Source” on the right of this code snippet.
Background and Explanation of the code
This program in PHP searches for bad or abusive words in a given string and replace them with a sequence of stars ‘*’. The list of abusive words can be taken from a central database. The code can be used in situations where a control over the user inputs is necessary such as in forums, blogs etc. to censor the user inputs.
This is a test paragraph. Some bad words: ****, ****