I have the following code to check if user input is a valid email, there might be a few questions already about this but noone seems to validate the PHP function.
/* check if valid email*/
public function isValidEmail($email){
if(filter_var($email, FILTER_VALIDATE_EMAIL)) {
return true;
}
return false;
}
If we do a test using this function:
isValidEmail('[email protected]')
This should return false because characters like ?= are inside the email address. Is there a stricter way to check email?
$epostbut then access it as$email- this won't check the passed variable.