Functions working backwards?
I'm not sure why, or maybe I'm tired and confused, but standard functions seem to work backwards for me...
e.g. preg_match() should return True if it finds a match right?
but to get my code to respond properly, I need to use !preg_match() as in: if(!preg_match('/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i',$mgEmail)){
list($username,$domain)=split('@',$mgEmail);
if($domain){
if(checkdnsrr($domain,'MX')) {
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
-------------------
And even the checkdnsrr() function, when tested, returns False on valid domains.
Can anyone explain this to me? Is it something in my php set up?
WHY WHY WHY???
Please help and thank you.
The best ideas are not the simple ones, they're the complex ones made easy.
|