Hi I'm currently having a syntex error with my bad words filter function
function filterBadWords($str)
{
$result1 = mysql_query("SELECT word FROM StringyChat_WordBan") or die(mysql_error());
$replacements = "x";
while($row = mysql_fetch_assoc($result1))
{
$str = preg_replace('/\b' . $row['word'].'\b/ie', ':-x', $str);
}
return $str;
}
I know its the :-x part causing the problem but how can I fix it?
and is there maybe a better way to do the filter because if I got the word "ass" in my list it will replace assassinate to :-x :-xinate ?