this code works all well and good... however, for some reason str_replace() is being case specific. just wonding if anybody has any ideas why/how to fix that... [code] <? function filter_censor($string,$badwords=array()){ foreach($badwords as $badword){ if(strpos($string, $badword)){ for($i=0;$i<strlen($badword);$i++) $x .= "*"; $censor = str_replace($badword, $x, $string); } } return $censor; } $badword[]="hello"; echo filter_censor("Hello",$badword); echo filter_censor("hello",$badword); ?> [/code]