2
class Check {
private static $Data;
private static $Format;
public static function Email($Email) {
self::$Data = (string) $Email;
self::$Format = "/[a-z0-9_\.\-]+@[a-z0-9_\.\-]*[a-z0-9_\.\-]+\.[a-z]{2,4}$/";
if (preg_match(self::$Data, self::$Format)):
return true;
else:
return false;
endif;
}
}
Above my code where I use, the pre_match
is making a mistake:
Delimiter must not be alphanumeric or backslash
I looked into it, but I couldn’t fix it. What I’m doing wrong ?
what the input data?
– RFL
email [email protected] , in case $Data is receiving this email.
– Diego Go
can’t help you, but for email validation I usually use filter_input($string, FILTER_VALIDATE_EMAIL)
– RFL
thanks, I got it with your tip ;)
– Diego Go