[PHP-DEV] Bug #2150: String comparison From: tri_kar <email protected>
Date: 08/25/99

From: tri_kar <email protected>
Operating system: win98
PHP version: 3.0.12
PHP Bug Type: Parser error
Bug description: String comparison

//IT DID NOT WORK with me
//can some one help me
/*what I am trying to do is compare strings and filter out garbage strings from the user in put by comaring it with my garbage file*/

<html>
<body>
<form>
<?
$gar=file("garbagewords.txt");
$words = explode(" ",$name);
 $temp=0;

 for($i=0; $i<count($words); $i++)
 {
  for($j=0; $j<count($gar); $j++)
  {
   if(($words[$i]==$gar[$j]) && (strlen($words[$i])== strlen($gar[$j])))
 {
  echo "Garbage =$gar[$j]<br>";
 }

 else if(($words[$i]!=$gar[$j]) && (strlen($words[$i])!= strlen($gar[$j])))
 {
  echo "Words=$words[$i]<br>";
 }
}
}
?>
<form method="post" action="<?php echo $PATH_INFO?>">
Search:<input type="Text" name="name" value=" "><br>
<input type="Submit" name="submit" value="Enter">
</form>
</body>
</html>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>