Badwords are bad, how can i get rid of them?
Posted: Wed Jul 03, 2002 2:17 am
i have a database table of bad words, how can i find all occurences of the words in a form text field and replace them with a blank?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$badwords = array('foo', 'bar', 'ick');
$my_dirty_text = 'This is a foo bar ick day';
$my_clean_text = str_replace($badwords, '', $my_dirty_text);
echo $my_clean_text;Code: Select all
This is a day