I am developing a user registration form and want to validate a user\'s email address. However,all the php docs I have read suggest the use of filter_var. My script validate
In your case you shouldn't use filter_var, but filter_input. This is all the code you would need:
filter_var
if ($email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)) { // email was submitted and is a valid email }
This bug might be related to your problem though.