I am trying to use preg_match() to check Arabic and English characters only,
i used this code:
preg_match("/^[a-zA-Zأ-ي]*$/",$name)
but still, it is not working.
EDIT: The code that does not work:
if($name == '' || $email =='') {
echo("<div class=\"error\">fill all fields</div>");
}
else if (!preg_match("/^[a-zA-Zأ-ي\s]*$/",$name)) {
echo("<div class=\"error\">Only letters and white space allowed</div>");
}
else if (strlen($name) < 6) {
echo("<div class=\"error\">NONONONO les than 6</div>");
}
else if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo("<div class=\"error\">WORNG EMAIL</div>");
} else {}