I'm trying to make my own bad word filter, and it works great, exept when I have multiple words in a sentence. So now What it does is, it takes the values out of the database and then loops trugh it and must replace the ad words.
Let me say I have (in dutch) this sentence: Deze kanker zooi moet eens stoppen! Het is godverdomme altijd het zelfde zooitje.. These are the words that must been replaced in the database:
kanker and godverdomme.
So I have in my database:

Thats all good, exept when the 2 ords must been replaced, then it doesn't want to replace...
My helper function:
public static function Filter($value)
{
$badwords = DB::table('badwords')->get();
foreach ($badwords as $badword)
{
$replaced = str_ireplace($badword->bad_word, $badword->replacement, $value);
}
return $replaced;
}
Hope someone can help me :)
Kindest regards,
Robin