Hello everyone,

I've been reading the "Profanity Filter" thread in the list archives but
haven't found anything real helpful.  Here's my code so far, this of course
won't work.
<?
function filterWords($string, &$result) {
        $badwords="shit, fuck, ass, bitch";
        $word=explode(", ", $badwords);
        for ($i=0; $i<count($word); $i++) {
                $replace = str_replace("$word[$i]", "****", $string);
        }
}
$string = "Ass monkey";
filterWords("$string", $result);
print "$result";
?>

How can I scan for the $badwords in $string and replace $badwords with ****?

Thanks,
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to