$arabicChars = "ء|آ|أ|ؤ|إ|ئ|ا|ب|ة|ت|ث|ج|ح|خ|د|ذ|ر|ز|س|ش|ص|ض|ط|ظ|ع|غ|ف|ق|ك|ل|م|ن|ه|و|ى|ي|٫|ٮ|ٯ";
$isArabic = mb_ereg(".*[$arabicCharsList].*", $str);
NOTE: you could detect any non-latin language by replacing the character list with the main characters of that language
Tweet
لاتعمل
ReplyDeleteجرب تضيف
Deletemb_regex_encoding('UTF-8');
قبل الكود