判断字符串emailAddr是否为合法的email格式
栏目:php教程时间:2013-12-05 17:32:16
-
-
-
-
-
-
- function emailCheck(emailAddr)
- {
- if((emailAddr == null) || (emailAddr.length < 2)) return false ;
-
- var aPos = emailAddr.indexOf("@" ,1) ;
- if(aPos < 0)
- {
- return false ;
- }
-
- if(emailAddr.indexOf("." ,aPos+2) < 0)
- {
- return false ;
- }
- return true ;
- }
------分隔线----------------------------
------分隔线----------------------------