Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 200003

Re: [PHP3] swear word checker From: Nicholas Burke (nick <email protected>)
Date: 03/31/00

thanks for everyones quick response..
 i ended up going with:

<?

$Data="this is a decent checker goes through everything pretty quickly, but its killing my fuckin head my hurts.";

echo $Data."<br>";

$q=new db;

$q->query("SELECT word FROM swear");

while ($q->next_record()) {
$word[]=$q->f("word");
}

$swear=0;

for ($i=0; $i<count($word); $i++) {
  if (eregi($word[$i], $Data, $regs)) {
    $swear=1;
    $word_total[]=$regs[0];
  }
}

if ($swear) {
 for ($i=0; $i<count($word_total); $i++) {
  echo "$word_total[$i]<br>";
 }
} else {
 echo "its all good";
}

?>

needed to track and specify the words.

thanks again..

Nick Burke

"Gentlemen, you can't fight in here... this is the war room."
Dr. Strangelove