Skip to content

Instantly share code, notes, and snippets.

@DHS
Created November 4, 2011 18:51
Show Gist options
  • Save DHS/1340150 to your computer and use it in GitHub Desktop.
Save DHS/1340150 to your computer and use it in GitHub Desktop.
PHP array of all country names
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe");
?>
@rehanshaikh1823
Copy link

'country_code_with_name' => [
    '+1' => 'United States',
    '+7' => 'Russia',
    '+20' => 'Egypt',
    '+27' => 'South Africa',
    '+30' => 'Greece',
    '+31' => 'Netherlands',
    '+32' => 'Belgium',
    '+33' => 'France',
    '+34' => 'Spain',
    '+36' => 'Hungary',
    '+39' => 'Italy',
    '+40' => 'Romania',
    '+41' => 'Switzerland',
    '+43' => 'Austria',
    '+44' => 'United Kingdom',
    '+45' => 'Denmark',
    '+46' => 'Sweden',
    '+48' => 'Poland',
    '+49' => 'Germany',
    '+51' => 'Peru',
    '+52' => 'Mexico',
    '+54' => 'Argentina',
    '+55' => 'Brazil',
    '+56' => 'Chile',
    '+57' => 'Colombia',
    '+58' => 'Venezuela',
    '+60' => 'Malaysia',
    '+61' => 'Australia',
    '+62' => 'Indonesia',
    '+63' => 'Philippines',
    '+64' => 'New Zealand',
    '+65' => 'Singapore',
    '+66' => 'Thailand',
    '+81' => 'Japan',
    '+82' => 'South Korea',
    '+84' => 'Vietnam',
    '+86' => 'China',
    '+90' => 'Turkey',
    '+91' => 'India',
    '+92' => 'Pakistan',
    '+93' => 'Afghanistan',
    '+94' => 'Sri Lanka',
    '+95' => 'Myanmar',
    '+98' => 'Iran',
    '+143' => 'Canada',
    '+212' => 'Morocco',
    '+216' => 'Tunisia',
    '+225' => 'Cote d\'Ivoire',
    '+234' => 'Nigeria',
    '+254' => 'Kenya',
    '+420' => 'Czech Republic',
    '+591' => 'Bolivia',
    '+673' => 'Brunei',
    '+678' => 'Vanuatu',
    '+679' => 'Fiji',
    '+682' => 'Cook Islands',
    '+683' => 'Niue',
    '+685' => 'Western Samoa',
    '+687' => 'American Samoa',
    '+688' => 'Nauru',
    '+689' => 'Kiribati',
    '+691' => 'Marshall Islands',
    '+692' => 'Micronesia (Federated States of)',
    '+694' => 'Palau',
    '+698' => 'Easter Island',
    '+850' => 'North Korea',
    '+852' => 'Hong Kong',
    '+853' => 'Macau',
    '+855' => 'Cambodia',
    '+886' => 'Taiwan',
    '+960' => 'Maldives',
    '+965' => 'Kuwait',
    '+966' => 'Saudi Arabia',
    '+967' => 'Yemen',
    '+968' => 'Oman',
    '+970' => 'Palestine',
    '+971' => 'United Arab Emirates',
    '+974' => 'Qatar',
    '+977' => 'Nepal',
    '+975' => 'Bhutan',
    '+976' => 'Mongolia',
    '+977' => 'Nepal',
    '+992' => 'Tajikistan',
    '+993' => 'Turkmenistan',
    '+994' => 'Azerbaijan',
    '+995' => 'Georgia',
    '+996' => 'Kyrgyzstan',
    '+998' => 'Uzbekistan',
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment