14 lines
446 B
PHP
14 lines
446 B
PHP
<?php
|
|
class Validate extends ValidateCore
|
|
{
|
|
/**
|
|
* Check for e-mail validity
|
|
*
|
|
* @param string $email e-mail address to validate
|
|
* @return boolean Validity is ok or not
|
|
*/
|
|
public static function isEmail($email)
|
|
{
|
|
return !empty($email) && preg_match(Tools::cleanNonUnicodeSupport('/^[a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z\p{L}0-9]+(?:[.]?[_a-z\p{L}0-9-])*\.[a-z\p{L}0-9]{2,}$/ui'), $email);
|
|
}
|
|
} |