Got some help this today (tnx Curt) from the list but for another chunk of the code I'm doing...
Now, I can't seem to get the following code to work... Have included some sample lines from the datafile (acc.txt)
No matter what I do, it always returns "not here" even if there is a match....very frustrating!
Any ideas?
Lloyd. :-)
---- Code Begin -----
<?php
$name_to_write = "user1"; $names = file("acc.txt");
if (in_array($name_to_write, $names)) { echo "hello"; } else { echo "not here"; } ?>
---- Code Finish ----
--- Sample Data Begin ---
user1 26:48:59 6 logins 4:28:09 hrs/login user2 19:07:50 33 logins 0:34:46 hrs/login user3 12:12:04 18 logins 0:40:40 hrs/login
--- Sample Data End ---
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php