Php > E-Mail
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; } } ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage