I need to allow Arabic usernames on my website which is already using ctype_alnum to validate the username field. When I try to use Arabic usernames,
ctype_alnum
username
You can find all Arabic Characters by using this Regex:
preg_match("/^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u", $string);
If the matched length equals the username length it is an arabic username.