I have a simple form with text area. I do not want it filled up with all kinds of badwords.
I have array like this:
$badword = array(“1bad” , “2bad” , “3bad” , “4bad”);
and…
$replacebadword = “bad***”;
foreach(badwords as $bad) {
$message = preg_replace($bad , $replacebadword , $message);
}
print “$message”;
pls help it’s not replaceing annything!. The $message is the textarea input string received from my form.
Geir