Answer the question
In order to leave comments, you need to log in
How to properly write email validation?
Validation for the field Name (contact) is registered in the module controller
if ((utf8_strlen($this->request->post['contact']) < 3) || (utf8_strlen($this->request->post['contact']) > 100)) {
$json['error']['contact'] = $this->language->get('error_contact');
}
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/filter.examples.validation.php
if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
echo "E-mail ($email_a) указан верно.";
}
Googling once or twice.
Here is an interesting way, by the way, without regular expressions:
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
// invalid emailaddress
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question