maltrecho
11-07-2003, 04:39 AM
I want to include a function in a page to filter all rude words submited by users. The filter should be something like (i.e.):
Words beginning by "abc", should be replaced with "****" or "oops" or whatever, so having an array like (i.e.):
$badwords = array(abc,aei,xyz);
How would the function look like to replace "abcde" and "aeiou" to "oops" when the input is (i.e.):
$text = "Hello abcde, what's up?. Your bro is an aeiou. Byeee"
So the output would be: "Hello oops, what's up?. Your bro is an oops. Byeee"
Is that clear? Thanks gurus.
Words beginning by "abc", should be replaced with "****" or "oops" or whatever, so having an array like (i.e.):
$badwords = array(abc,aei,xyz);
How would the function look like to replace "abcde" and "aeiou" to "oops" when the input is (i.e.):
$text = "Hello abcde, what's up?. Your bro is an aeiou. Byeee"
So the output would be: "Hello oops, what's up?. Your bro is an oops. Byeee"
Is that clear? Thanks gurus.