Re: Profanity Filter

From: Date: Sat, 20 Jan 2001 17:44:46 +0000
Subject: Re: Profanity Filter
Groups: php.general 
Request: Send a blank email to php-general+get-35817@lists.php.net to get a copy of this message
Ok, I am now using the following code to check if there is any profanity in the $FirstName however it just doesn`t work when testing, I am thinking it has something to do with the way I`m loading the file, any better ways. $words=file('words.txt'); $done=false; while ((list($key, $val)=each($words)) and $done==false) { $done=strpos(strtolower($FirstName), $val); }; if (!$done==false) { echo "Oops! Bad name"; } else { echo"Okay, valid name."; };

« previous php.general (#35817) next »