note 26172 added to function.preg-match
| From: | jason dot adamczyk at tik dot com dot au | Date: | Mon, 21 Oct 2002 13:57:43 +0000 |
| Subject: | note 26172 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38361@lists.php.net to get a copy of this message | ||
I cant get a script to match a couple of variables. if ne1 can help, it would be greatly
appreciated!
nb: users.access is a standard txt file
what goes wrong: The script always returns $valid as false.
$users = file("users.access") ;
$valid = false;
for ($i = 0 ; $i > $users.length ; $i ++)
{
$temp = $users[$i];
if ( preg_match("/jason ; admin/i" , $temp) > 0 )
{
$valid = true;
break;
}
}
--
http://www.php.net/manual/en/function.preg-match.php
http://master.php.net/manage/user-notes.php?action=edit+26172
http://master.php.net/manage/user-notes.php?action=delete+26172
http://master.php.net/manage/user-notes.php?action=reject+26172