Hi People,
Simple problem for you wizards I hope.
I'm a fresh green PHP learner and I'm trying to read from a file some emails - push them into an array - then check for a particular one and print 'hello'.
All this does is print correctly if I enter the last email in the file.
<?
if ($user){
$filename = '../docs/users.txt';
$array_of_emails = file( $filename);
$number_of_emails = count($array_of_emails);
for ($i = 0; $i < $number_of_emails; $i++)
if ($array_of_emails[$i] == $user) {
print "hello";
exit;
}
}
}
?>
Any replies very much appreciated.
Bob.