I have a table with a list of kewords or phrases that will contain bad or swear words.
CREATE TABLE IF NOT EXISTS `bad_words` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `bad_words` (`keywords`) VALUES
('badword1\r\badword2\r\bad phrase1\r\bad phrase2');
What is the easiet way to check posted data for bad words and if found remove them.
Say for example
$_POST[‘description’] = “this contains badword1 and bad prases2”;
$_POST[‘itemname] = “badword1 is in name”;
Also, should I be storing the words or phrases differently in the table, perhaps one word or phrase per record, or perhaps in an array?
Thanks in advance for your help.