php email 正则-验证email地址格式合法性

php技巧

在注册程序中常常需要php email 的正则规则,来验证验证email地址格式合法性
发现discuz他们家的判断函数倒是很实用的

function check_emailformat($email)
{
	return (strlen($email)>6) && preg_match("/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/", $email);
}

Leave a Reply

Icons by N.Design Studio. Designed By Ben Swift. Powered by WordPress and Free WordPress Themes
Entries RSS Comments RSS Log in