PHP Tutorial : Function – Filter unwanted words

Hello,

I finded it usefull to build a simple and maximum 10 lines of code php function which can be used in filtering words that you wouldn’t want to appear on your website, forum, guestbook, comments, etc.

The most common way where is to use it within a html form, validating an input, textarea element, etc.

The code is built and commented below :

Usage of this php function to filter unwanted words : firstly, build an php array with unwanted words, then apply the function where you need it. Example :

Feel free to use it anywhere!

Tagged with: , , , ,
Posted in Short PHP Functions

Leave a Reply

Your email address will not be published. Required fields are marked *

*