php - check correct email format for swedish letters -



php - check correct email format for swedish letters -

i'm making website has form gets validated in php. when people post form email gets sent $email variable , check right format. i've yet find piece of code checks if format right (if valid doesnt matter right now), i've found phps own function doesnt check swedish letters, i've found function checks mail service format breaks if have email format xxx.yy@zz.aa. works if format xxx@zz.aa.

i much appreciate help create work , find function works.

you can utilize regexp:

if(preg_match("/^\b[a-zÅÄÖåäö0-9._%+-]+@[a-zÅÄÖåäö0-9.-]+\.[a-z]{2,4}\b$/i",$email)){ //mail valid }

this validate youråäö@adressö.se etc.

php forms validation

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -