For the feedback form on my site, I want to aviod sending emails that contain certain words. I was wondering how i would detect it, e.g. finding the word 'idiot' in:-
231232312321idiot32432432423
How would i do that?????
$pattern="/idiot|bastard?/i";
if (preg_match($pattern, $str)) {echo "found";} else {echo "not found";};
You can expand $pattern with all the words you want to find using regular expressions....