added lang emojy function

A1Gard 7 months ago
parent 32f783f198
commit 9b1bc39656

@ -938,3 +938,85 @@ function digitsToLatin($number)
$number = str_replace($arabic2, $latin, $number);
return str_replace($arabic, $latin, $number);
}
/**
* @param $lang code like fa
* @return string
*/
function getEmojiLanguagebyCode($lang) {
$languages = array(
"af" => "🇿🇦", // Afrikaans
"sq" => "🇦🇱", // Albanian
"am" => "🇪🇹", // Amharic
"ar" => "🇸🇦", // Arabic
"hy" => "🇦🇲", // Armenian
"az" => "🇦🇿", // Azerbaijani
"eu" => "🇪🇸", // Basque
"be" => "🇧🇾", // Belarusian
"bn" => "🇧🇩", // Bengali
"bs" => "🇧🇦", // Bosnian
"bg" => "🇧🇬", // Bulgarian
"ca" => "🇪🇸", // Catalan
"zh" => "🇨🇳", // Chinese
"hr" => "🇭🇷", // Croatian
"cs" => "🇨🇿", // Czech
"da" => "🇩🇰", // Danish
"nl" => "🇳🇱", // Dutch
"en" => "🇬🇧", // English
"et" => "🇪🇪", // Estonian
"fi" => "🇫🇮", // Finnish
"fr" => "🇫🇷", // French
"gl" => "🇪🇸", // Galician
"ka" => "🇬🇪", // Georgian
"de" => "🇩🇪", // German
"el" => "🇬🇷", // Greek
"gu" => "🇮🇳", // Gujarati
"ht" => "🇭🇹", // Haitian
"he" => "🇮🇱", // Hebrew
"hi" => "🇮🇳", // Hindi
"hu" => "🇭🇺", // Hungarian
"is" => "🇮🇸", // Icelandic
"id" => "🇮🇩", // Indonesian
"ga" => "🇮🇪", // Irish
"it" => "🇮🇹", // Italian
"ja" => "🇯🇵", // Japanese
"kk" => "🇰🇿", // Kazakh
"ko" => "🇰🇷", // Korean
"lv" => "🇱🇻", // Latvian
"lt" => "🇱🇹", // Lithuanian
"mk" => "🇲🇰", // Macedonian
"ms" => "🇲🇾", // Malay
"ml" => "🇮🇳", // Malayalam
"mt" => "🇲🇹", // Maltese
"mn" => "🇲🇳", // Mongolian
"no" => "🇳🇴", // Norwegian
"ps" => "🇦🇫", // Pashto
"fa" => "🇮🇷", // Persian
"pl" => "🇵🇱", // Polish
"pt" => "🇵🇹", // Portuguese
"ro" => "🇷🇴", // Romanian
"ru" => "🇷🇺", // Russian
"sr" => "🇷🇸", // Serbian
"sk" => "🇸🇰", // Slovak
"sl" => "🇸🇮", // Slovenian
"es" => "🇪🇸", // Spanish
"sw" => "🇰🇪", // Swahili
"sv" => "🇸🇪", // Swedish
"ta" => "🇮🇳", // Tamil
"te" => "🇮🇳", // Telugu
"th" => "🇹🇭", // Thai
"tr" => "🇹🇷", // Turkish
"uk" => "🇺🇦", // Ukrainian
"ur" => "🇵🇰", // Urdu
"uz" => "🇺🇿", // Uzbek
"vi" => "🇻🇳", // Vietnamese
"cy" => "🇬🇧" // Welsh
);
$lang = strtolower($lang);
if (array_key_exists($lang, $languages)) {
return $languages[$lang];
} else {
return "❓";
}
}

Loading…
Cancel
Save