Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Php Programming Code Examples

Php > E-Mail Code Examples

Checks if an e-mail looks like a valid one. Returns TRUE if the mail is correct

Checks if an e-mail looks like a valid one. Returns TRUE if the mail is correct or FASLE if the mail isn't correct <? if (checkmail($mail)) { print("Your adress is correct"); } else { print("Your adress isn't correct"); } function checkmail($mail){ $mail2 = trim($mail); $lg=strlen($mail2); $pos1=strrpos($mail2,"."); $pos2=strrpos($mail2,"@"); if(ereg("@",$mail2) and $pos1>$pos2 and $lg>5 and $pos2>=1) { if (ereg(" ",$mail2)) { return false; } else { return true; } } else { return false; } } ?>