I've been up all night trying to finish a little project. Part of it involves a login script - nothing big or important, but I can't use pear modules due to client's paranoid sysadmin.
Anyhow, I'm having trouble with one ridiculously simple snippet of code. Any help deeply appreciated.
Code: Select all
foreach ($passwordarray['username'] as $key=>$value) {
echo $value;
$debugvar = 'supergrover';
if ($value == 'supergrover') {
echo "You're in!";
}
}If I replace $value in the conditional with $debugvar, it works fine. If I change the 'supergrover' value in the conditional to any other value in the $passwordarray['username'] array, the problem still occurs.
A var_dump of $passwordarray['username']:
array(2) { [0]=> string(17) "supergrover
" [2]=> string(14) "testuser
" }
Any suggestions really appreciated - I'm sure I'm missing something ridiculously simple, but I'm completely stumped.
Cheers,
- JB