Taylor_1978
06-01-2004, 06:57 PM
Hi Folks,
In the message forum I have built, I have added str_replace to void out naughty words!!! (LOL)
Here is what I have:
$result = mysql_db_query($db, "SELECT * FROM words WHERE id>0");
while ($row = mysql_fetch_array($result)) {
$word = $row["word"];
$message = str_replace($word,"****",$message);
}
Problem is, lets say the value of $word = cat. If the $message has 'cat' in it then it replaces it with '****'. Problem is, if the message contains 'Cat' or 'cat!' etc it won't replace it!
Is there any way around this other than say making the entire message lower case.
Thanks in advance! :thumbsup:
Taylor.
In the message forum I have built, I have added str_replace to void out naughty words!!! (LOL)
Here is what I have:
$result = mysql_db_query($db, "SELECT * FROM words WHERE id>0");
while ($row = mysql_fetch_array($result)) {
$word = $row["word"];
$message = str_replace($word,"****",$message);
}
Problem is, lets say the value of $word = cat. If the $message has 'cat' in it then it replaces it with '****'. Problem is, if the message contains 'Cat' or 'cat!' etc it won't replace it!
Is there any way around this other than say making the entire message lower case.
Thanks in advance! :thumbsup:
Taylor.