regex - PHP - Email Validation -
possible duplicate:
email address validation
hello. have function validate email address
function isvalidemail($email){ return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email); }
it works domain zones .com, .us etc, contain 2 3 symbols after dot. question is: important include such zones .info or .travel length more 3 symbols , should worry multiple .co.uk etc.? how improve function these needs?
there native function in php this, test , see if fits needs:
var_dump(filter_var('bob@example.com', filter_validate_email));
p.s: isn't eregi()
deprecated?
Comments
Post a Comment