Last active
March 8, 2017 14:08
-
-
Save alash3al/7408cbf3df69b2f6d7a7 to your computer and use it in GitHub Desktop.
has_ar(), check if string contains arabic char(s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check if string has an arabic char | |
* @author Mohammed Alashaal <fb.com/alash3al> | |
* @param element str | |
* @return bool | |
*/ | |
function has_ar(str) | |
{ | |
var x = /[\u0600-\u06FF]+/; | |
return x.test(str); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment