Re[2]: [PHP] adult content censoring
| From: | Richard Davey | Date: | Sun, 25 Apr 2004 16:10:48 +0000 |
| Subject: | Re[2]: [PHP] adult content censoring | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184570@lists.php.net to get a copy of this message | ||
Hello Curt,
Sunday, April 25, 2004, 4:28:37 PM, you wrote:
CZ> Also instead of str_replace scanning the whole string 5 time to
CZ> replace the 5 items, its only scanned once, replacing up to five
CZ> things.
My method *did* only scan the string once and str_replace is
definitely faster than preg_replace.
But I agree with the preg use for more complex word catching, but even
using that method you could spend ages building up a definitive
"badwords" array. I guess it depends how anal you want to be ;) (heh)
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html