What you could do is have a bad word and a reallybadword list.  Wank could
be a bad word and if it didn't appear along (ie. whitespace on either
side, or in plural) then it is ok.  In really bad word, say F*ck, then it
couldn't appear at all...( ie. f*ckville would be invalid).

It would mean a second loop...but not much more processing...

Just my 2 cents.

Fraser

On Sat, 20 Jan 2001, Nik Gare wrote:

> In article <94adfp$5le$[EMAIL PROTECTED]>,
>    Stephan Ahonen <[EMAIL PROTECTED]> wrote:
> > I'd make it an array:
> 
> > $filter = array(moron, idiot, pratt);
> 
> > foreach($filter as $badword) {
> >  if (strstr($name, $badword)) {
> >   do this if it contains one of the bad words
> >  }
> >  else {
> >   do this if it doesn't
> >  }
> > }
> 
> But wouldn't this approach have its drawbacks, too?
> For example, I live in Kiel, Germany, about 20km from a town called
> Wankendorf.  Presumably I wouldnÄt be able to say this.
> 
> Nik
> 
> 
> --
> 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]
> 
> 


--
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