Bug #2150: String comparison

From: Date: Wed, 25 Aug 1999 17:44:33 +0000
Subject: Bug #2150: String comparison
Groups: php.dev 
Request: Send a blank email to php-dev+get-10193@lists.php.net to get a copy of this message
From: tri_kar@hotmail.com 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>

« previous php.dev (#10193) next »