Heres the update, first I tryed str_replace, and that just issued a fatal error on maximum execution of 30 seconds. I then tryed the var_dump, and
string(3) "345" string(4) "642 "
::string(3) "345" string(4) "345 "
Yes your invite matched one in our database.string(3) "345" string(3) "326"
::string(3) "345" NULL
::string(3) "345" NULL // I get dozens of these continued down
Seeing that ::string(3) "345" NULL was repeaded a couple of dozen times I thought something must be wrong with the for loop. So I changed the condition <= to just a lessthen because when I printed the value of $n I found that although sizeof($lines) was 3 the value of $n was going 0 1 2 3
This fixed the problem of the repeating ::string(3) "345" NULL and made execution time cut down dramaticaly. But still the statement wasnt matching and seeing the var dump gave the space at the end, and str_replace was not geting rid of it I tryed rtrim again. This time rtrim worked and execution time was normal.
My conclusion it was a dual problem of one my for loop conditional statement and there was not a new line but a leading white space instead, so rtrim came to my resuce.
thank you both, useing both of your sugestions I was able to narow down my bug.
for ($n = 0; $n < sizeof($lines); $n++){ // loop through invites
$lines[$n] = rtrim($lines[$n]);
if ($invite == $lines[$n]){
print "<br>Yes your invite matched one in our database.";
$ok = 1; // you were invited so lets continue
}
}