<?php

/*=================================================================*\
| +---------------------------------------------------------------+ |
| |     Badword Filter - unerlaubte Wörter unkenntlich machen     | |
| |---------------------------------------------------------------| |
| |                    http://www.phpbuddy.eu/                    | |
| +---------------------------------------------------------------+ |
\*=================================================================*/

// UTF-8 Header
header'Content-Type: text/html; charset=utf-8' );

$badword = array
(
    
"hund",
    
"wurst",
    
"kochbuch",
);

$text 'Der dumme Hund hat versucht das Bild von der Wurst aus dem Kochbuch zu fressen.';

foreach (
$badword as $wort)
{
    
$text str_ireplace$wortstr_repeat"*"strlen$wort ) ), $text);
}

echo 
$text;