Re: Searching a test file...
| From: | Mike Migurski | Date: | Tue, 15 Jul 2003 07:14:08 +0000 |
| Subject: | Re: Searching a test file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155234@lists.php.net to get a copy of this message | ||
>No matter what I do, it always returns "not here" even if there is a
>match....very frustrating!
>
>Any ideas?
-snip-
Looks like you are attempting to match 'user1' to "user1 26:48:59 6 logins
4:28:09 hrs/login\n", which will come up false. You'll need to either do
some postprocessing on the file, to extract just the user id, or you'll
need to replace your in_array() check with a loop or array_map() that
compares the name you want against just the relevant portions of the line,
perhaps using a function such as strstr() or preg_match() or
reset(explode()).
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html