Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shahid249/cd5d8d04510ffe8ad1763477fedd9591 to your computer and use it in GitHub Desktop.
Save shahid249/cd5d8d04510ffe8ad1763477fedd9591 to your computer and use it in GitHub Desktop.
This array containg country and its languages code. Most of the Country language code hasbeen added, but some of them are missing.
<?php
$countries = array
(
'AF' => 'ps-AR',
'AX' => 'Aland Islands',
'AL' => 'sq-AL',
'DZ' => 'ar-DZ',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Barbuda And Barbuda',
'AR' => 'es-AR',
'AM' => 'hy-AM',
'AW' => 'Aruba',
'AU' => 'en-AU',
'AT' => 'de-AT',
'AZ' => 'az-AZ',
'BS' => 'Bahamas',
'BH' => 'ar-BH',
'BD' => 'Bangladesh',
'BB' => 'Barbados',
'BY' => 'be-BY',
'BE' => 'fr-BE',
'BZ' => 'en-BZ',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'es-BO',
'BA' => 'hr-BA',
'BW' => 'Botswana',
'BV' => 'Bouvet Island',
'BR' => 'pt-BR',
'IO' => 'British Indian Ocean Territory',
'BN' => 'ms-BN',
'BG' => 'bg-BG',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'en-CA',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'CF' => 'Central African Republic',
'TD' => 'Chad',
'CL' => 'es-CL',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Islands',
'CO' => 'es-CO',
'KM' => 'Comoros',
'CG' => 'Congo',
'CD' => 'Congo, Democratic Republic',
'CK' => 'Cook Islands',
'CR' => 'es-CR',
'CI' => 'Cote D\'Ivoire',
'HR' => 'hr-HR',
'CU' => 'Cuba',
'CY' => 'Cyprus',
'CZ' => 'cs-CZ',
'DK' => 'da-DK',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'es-DO',
'EC' => 'es-EC',
'EG' => 'ar-EG',
'SV' => 'es-SV',
'GQ' => 'Equatorial Guinea',
'ER' => 'Eritrea',
'EE' => 'et-EE',
'ET' => 'et',
'FK' => 'Falkland Islands (Malvinas)',
'FO' => 'fo-FO',
'FJ' => 'Fiji',
'FI' => 'se-FI',
'FR' => 'fr-FR',
'GF' => 'French Guiana',
'PF' => 'French Polynesia',
'TF' => 'French Southern Territories',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'ka-GE',
'DE' => 'de-DE',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GR' => 'el-GR',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe',
'GU' => 'Guam',
'GT' => 'es-GT',
'GG' => 'Guernsey',
'GN' => 'Guinea',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HM' => 'Heard Island & Mcdonald Islands',
'VA' => 'Holy See (Vatican City State)',
'HN' => 'es-HN',
'HK' => 'zh-HK',
'HU' => 'hu-HU',
'IS' => 'is-IS',
'IN' => 'en-IN',
'ID' => 'id-ID',
'IR' => 'fa-IR',
'IQ' => 'ar-IQ',
'IE' => 'en-IE',
'IM' => 'Isle Of Man',
'IL' => 'he-IL',
'IT' => 'it-IT',
'JM' => 'en-JM',
'JP' => 'ja-JP',
'JE' => 'Jersey',
'JO' => 'ar-JO',
'KZ' => 'kk-KZ',
'KE' => 'sw-KE',
'KI' => 'Kiribati',
'KR' => 'ko-KR',
'KW' => 'ar-KW',
'KG' => 'ky-KG',
'LA' => 'Lao People\'s Democratic Republic',
'LV' => 'lv-LV',
'LB' => 'ar-LB',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libyan Arab Jamahiriya',
'LI' => 'de-LI',
'LT' => 'lt-LT',
'LU' => 'de-LU',
'MO' => 'Macao',
'MK' => 'mk-MK',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'ms-MY',
'MV' => 'dv-MV',
'ML' => 'Mali',
'MT' => 'mt-MT',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MX' => 'es-MX',
'FM' => 'Micronesia, Federated States Of',
'MD' => 'Moldova',
'MC' => 'fr-MC',
'MN' => 'mn-MN',
'ME' => 'sr-SP',
'MS' => 'Montserrat',
'MA' => 'ar-MA',
'MZ' => 'Mozambique',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'NL' => 'nl-NL',
'AN' => 'Netherlands Antilles',
'NC' => 'New Caledonia',
'NZ' => 'en-NZ',
'NI' => 'es-NI',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'MP' => 'Northern Mariana Islands',
'NO' => 'se-NO',
'OM' => 'ar-OM',
'PK' => 'ur-PK',
'PW' => 'Palau',
'PS' => 'Palestinian Territory, Occupied',
'PA' => 'es-PA',
'PG' => 'Papua New Guinea',
'PY' => 'es-PY',
'PE' => 'qu-PE',
'PH' => 'tl-PH',
'PN' => 'Pitcairn',
'PL' => 'pl-PL',
'PT' => 'pt-PT',
'PR' => 'es-PR',
'QA' => 'ar-QA',
'RE' => 'Reunion',
'RO' => 'ro-RO',
'RU' => 'ru-RU',
'RW' => 'Rwanda',
'BL' => 'Saint Barthelemy',
'SH' => 'Saint Helena',
'KN' => 'Saint Kitts And Nevis',
'LC' => 'Saint Lucia',
'MF' => 'Saint Martin',
'PM' => 'Saint Pierre And Miquelon',
'VC' => 'Saint Vincent And Grenadines',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'Sao Tome And Principe',
'SA' => 'ar-SA',
'SN' => 'Senegal',
'RS' => 'sr-SP',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'zh-SG',
'SK' => 'sk-SK',
'SI' => 'sl-SI',
'SB' => 'Solomon Islands',
'SO' => 'Somalia',
'ZA' => 'tn-ZA',
'GS' => 'ka-GE',
'ES' => 'ca-ES',
'LK' => 'Sri Lanka',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SJ' => 'Svalbard And Jan Mayen',
'SZ' => 'Swaziland',
'SE' => 'se-SE',
'CH' => 'de-CH',
'SY' => 'Syrian Arab Republic',
'TW' => 'Taiwan',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania',
'TH' => 'th-TH',
'TL' => 'Timor-Leste',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'en-TT',
'TN' => 'ar-TN',
'TR' => 'tr-TR',
'TM' => 'Turkmenistan',
'TC' => 'Turks And Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'uk-UA',
'AE' => 'ar-AE',
'GB' => 'cy-GB',
'US' => 'en-US',
'UM' => 'United States Outlying Islands',
'UY' => 'es-UY',
'UZ' => 'uz-UZ',
'VU' => 'Vanuatu',
'VE' => 'es-VE',
'VN' => 'vi-VN',
'VG' => 'Virgin Islands, British',
'VI' => 'Virgin Islands, U.S.',
'WF' => 'Wallis And Futuna',
'EH' => 'Western Sahara',
'YE' => 'ar-YE',
'ZM' => 'Zambia',
'ZW' => 'en-ZW',
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment