arrgs ich habe das nun so gemacht aber das funktioniert nicht ?!?
könnt ihr mir sagen warum? ich will die variable $bemerkung checken...
$word_list = array ("schwanz","****er","sex","porn","****","xxx","****","verdammt","******","*******","verflucht","schwul","**********","gay","*****","wix","wichs","blöd","bloed","****","****","schrott","mist");
$contra = "*****";
function check_content($kommentar) {
global $word_list, $contra;
$list_size = count($word_list);
$count = 0;
for ($q=0; $q<=$list_size-1; $q++) {
$bad_word_check = strstr($kommentar,$word_list[$q]);
if ($bad_word_check != FALSE) {
$position = strpos($kommentar,$word_list[$q]);
$first = substr($kommentar,0,$position);
$scnd = substr($kommentar,$position);
$count_chars = strlen($exclusion[$q]);
$bad_word = substr($scnd,0,$count_chars);
$scnd = substr($scnd,$count_chars);
$bad_word = str_replace($bad_word,$bad_word,$contra);
$kommentar = $first . $bad_word . $scnd;
$count++;
}
}
if ($count > 0) {
return $kommentar;
} else {
return FALSE;
}
}
[/PHP]