|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-08-29 11:17 UTC] sas at cvs dot php dot net
[1999-09-04 18:41 UTC] riffraff at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
//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>