-1
elseif(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $user_email)) 

即使我也尝试preg_match过,我也得到了

警告:

preg_match() [function.preg-match]: No ending delimiter '^' found in C:\wamp\www\Saravanan\jQuery\jQuery - Samples\sign_and_login_using_jquery_ajax_and_php\sign_and_login_using_jquery_ajax_and_php\vpb_save_details.php on line 29
Call Stack
4

2 回答 2

2

使用这个:

if(!filter_var($user_email,FILTER_VALIDATE_EMAIL))
于 2013-04-09T07:25:21.990 回答
1

如果 var 来自 POST:

if (!filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL))
于 2013-04-09T07:27:22.847 回答