List of world countries in php array

	$country_list = array(
		"Afghanistan",
		"Albania",
		"Algeria",
		"Andorra",
		"Angola",
		"Antigua and Barbuda",
		"Argentina",
		"Armenia",
		"Australia",
		"Austria",
		"Azerbaijan",
		"Bahamas",
		"Bahrain",
		"Bangladesh",
		"Barbados",
		"Belarus",
		"Belgium",
		"Belize",
		"Benin",
		"Bhutan",
		"Bolivia",
		"Bosnia and Herzegovina",
		"Botswana",
		"Brazil",
		"Brunei",
		"Bulgaria",
		"Burkina Faso",
		"Burundi",
		"Cambodia",
		"Cameroon",
		"Canada",
		"Cape Verde",
		"Central African Republic",
		"Chad",
		"Chile",
		"China",
		"Colombi",
		"Comoros",
		"Congo (Brazzaville)",
		"Congo",
		"Costa Rica",
		"Cote d'Ivoire",
		"Croatia",
		"Cuba",
		"Cyprus",
		"Czech Republic",
		"Denmark",
		"Djibouti",
		"Dominica",
		"Dominican Republic",
		"East Timor (Timor Timur)",
		"Ecuador",
		"Egypt",
		"El Salvador",
		"Equatorial Guinea",
		"Eritrea",
		"Estonia",
		"Ethiopia",
		"Fiji",
		"Finland",
		"France",
		"Gabon",
		"Gambia, The",
		"Georgia",
		"Germany",
		"Ghana",
		"Greece",
		"Grenada",
		"Guatemala",
		"Guinea",
		"Guinea-Bissau",
		"Guyana",
		"Haiti",
		"Honduras",
		"Hungary",
		"Iceland",
		"India",
		"Indonesia",
		"Iran",
		"Iraq",
		"Ireland",
		"Israel",
		"Italy",
		"Jamaica",
		"Japan",
		"Jordan",
		"Kazakhstan",
		"Kenya",
		"Kiribati",
		"Korea, North",
		"Korea, South",
		"Kuwait",
		"Kyrgyzstan",
		"Laos",
		"Latvia",
		"Lebanon",
		"Lesotho",
		"Liberia",
		"Libya",
		"Liechtenstein",
		"Lithuania",
		"Luxembourg",
		"Macedonia",
		"Madagascar",
		"Malawi",
		"Malaysia",
		"Maldives",
		"Mali",
		"Malta",
		"Marshall Islands",
		"Mauritania",
		"Mauritius",
		"Mexico",
		"Micronesia",
		"Moldova",
		"Monaco",
		"Mongolia",
		"Morocco",
		"Mozambique",
		"Myanmar",
		"Namibia",
		"Nauru",
		"Nepal",
		"Netherlands",
		"New Zealand",
		"Nicaragua",
		"Niger",
		"Nigeria",
		"Norway",
		"Oman",
		"Pakistan",
		"Palau",
		"Panama",
		"Papua New Guinea",
		"Paraguay",
		"Peru",
		"Philippines",
		"Poland",
		"Portugal",
		"Qatar",
		"Romania",
		"Russia",
		"Rwanda",
		"Saint Kitts and Nevis",
		"Saint Lucia",
		"Saint Vincent",
		"Samoa",
		"San Marino",
		"Sao Tome and Principe",
		"Saudi Arabia",
		"Senegal",
		"Serbia and Montenegro",
		"Seychelles",
		"Sierra Leone",
		"Singapore",
		"Slovakia",
		"Slovenia",
		"Solomon Islands",
		"Somalia",
		"South Africa",
		"Spain",
		"Sri Lanka",
		"Sudan",
		"Suriname",
		"Swaziland",
		"Sweden",
		"Switzerland",
		"Syria",
		"Taiwan",
		"Tajikistan",
		"Tanzania",
		"Thailand",
		"Togo",
		"Tonga",
		"Trinidad and Tobago",
		"Tunisia",
		"Turkey",
		"Turkmenistan",
		"Tuvalu",
		"Uganda",
		"Ukraine",
		"United Arab Emirates",
		"United Kingdom",
		"United States",
		"Uruguay",
		"Uzbekistan",
		"Vanuatu",
		"Vatican City",
		"Venezuela",
		"Vietnam",
		"Yemen",
		"Zambia",
		"Zimbabwe"
	);

 

Post a comment (fixed now)

Comments:

Aju Chacko (18-03-2008 13:47) :
Very very useful..i clicked three ads..but i know it doesn't value your help.

John Smith (16-04-2008 16:02) :
Great,,, but why Palestine not exist in the list!!!

Steven Marx (25-04-2008 20:55) :
Just what I needed, thanks. Would be even better without line breaks between countries, but that's a quibble.

Mark Ormesher (25-05-2008 12:42) :
Nice one, very useful!

erm... (06-06-2008 16:35) :
United kingdom is NOT a country... so you need scotland, england, wales, northern ireland & republic of ireland (thats isnt even in the UK!)

alli (22-07-2008 15:56) :
thanks for this, saved me a fair bit of work =]

thanks so mcuh! (14-09-2008 14:40) :
thanks!!!

the uk is a country, wiki it :)

evilunix (02-10-2008 17:28) :
i just had to go through an entire list of countries by hand so it would remember the selection if the form didn't validate.. haha :/

bagyo (05-11-2008 20:46) :
thanks so much... very useful

jothikumar (21-01-2009 14:31) :
It very usefull to me in easy to colect all country

badadam (23-02-2009 15:15) :
very handy - thanks

some dude (05-03-2009 11:37) :
Hong Kong and Macau are still countries.. they will become "China" from 2047.

Please modify your shit.

emran (20-03-2009 11:56) :
Great help.thanks a lot.

edesa (21-07-2009 20:00) :
very useful, I clicked ads too, :)

renjith (27-08-2009 10:03) :
its verry help full fr mee.... if it is in the key=>value form its more helpfull...

ALoses (18-09-2009 16:53) :
Here you go!
$country_list = array(
'1'=>"Afghanistan",
'2'=>"Albania",
'3'=>"Algeria",
'4'=>"Andorra",
'5'=>"Angola",
'6'=>"Antigua and Barbuda",
'7'=>"Argentina",
'8'=>"Armenia",
'9'=>"Australia",
'10'=>"Austria",
'11'=>"Azerbaijan",
'12'=>"Bahamas",
'13'=>"Bahrain",
'14'=>"Bangladesh",
'15'=>"Barbados",
'16'=>"Belarus",
'17'=>"Belgium",
'18'=>"Belize",
'19'=>"Benin",
'20'=>"Bhutan",
'21'=>"Bolivia",
'22'=>"Bosnia and Herzegovina",
'23'=>"Botswana",
'24'=>"Brazil",
'25'=>"Brunei",
'26'=>"Bulgaria",
'27'=>"Burkina Faso",
'28'=>"Burundi",
'29'=>"Cambodia",
'30'=>"Cameroon",
'31'=>"Canada",
'32'=>"Cape Verde",
'33'=>"Central African Republic",
'34'=>"Chad",
'35'=>"Chile",
'36'=>"China",
'37'=>"Colombi",
'38'=>"Comoros",
'39'=>"Congo (Brazzaville)",
'40'=>"Congo",
'41'=>"Costa Rica",
'42'=>"Cote d'Ivoire",
'43'=>"Croatia",
'44'=>"Cuba",
'45'=>"Cyprus",
'46'=>"Czech Republic",
'47'=>"Denmark",
'48'=>"Djibouti",
'49'=>"Dominica",
'50'=>"Dominican Republic",
'51'=>"East Timor (Timor Timur)",
'52'=>"Ecuador",
'53'=>"Egypt",
'54'=>"El Salvador",
'55'=>"Equatorial Guinea",
'56'=>"Eritrea",
'57'=>"Estonia",
'58'=>"Ethiopia",
'59'=>"Fiji",
'60'=>"Finland",
'61'=>"France",
'62'=>"Gabon",
'63'=>"Gambia, The",
'64'=>"Georgia",
'65'=>"Germany",
'66'=>"Ghana",
'67'=>"Greece",
'68'=>"Grenada",
'69'=>"Guatemala",
'70'=>"Guinea",
'71'=>"Guinea-Bissau",
'72'=>"Guyana",
'73'=>"Haiti",
'74'=>"Honduras",
'75'=>"Hungary",
'76'=>"Iceland",
'77'=>"India",
'78'=>"Indonesia",
'79'=>"Iran",
'80'=>"Iraq",
'81'=>"Ireland",
'82'=>"Israel",
'83'=>"Italy",
'84'=>"Jamaica",
'85'=>"Japan",
'86'=>"Jordan",
'87'=>"Kazakhstan",
'88'=>"Kenya",
'89'=>"Kiribati",
'90'=>"Korea, North",
'91'=>"Korea, South",
'92'=>"Kuwait",
'93'=>"Kyrgyzstan",
'94'=>"Laos",
'95'=>"Latvia",
'96'=>"Lebanon",
'97'=>"Lesotho",
'98'=>"Liberia",
'99'=>"Libya",
'100'=>"Liechtenstein",
'101'=>"Lithuania",
'102'=>"Luxembourg",
'103'=>"Macedonia",
'104'=>"Madagascar",
'105'=>"Malawi",
'106'=>"Malaysia",
'107'=>"Maldives",
'108'=>"Mali",
'109'=>"Malta",
'110'=>"Marshall Islands",
'111'=>"Mauritania",
'112'=>"Mauritius",
'113'=>"Mexico",
'114'=>"Micronesia",
'115'=>"Moldova",
'116'=>"Monaco",
'117'=>"Mongolia",
'118'=>"Morocco",
'119'=>"Mozambique",
'120'=>"Myanmar",
'121'=>"Namibia",
'122'=>"Nauru",
'123'=>"Nepa",
'124'=>"Netherlands",
'125'=>"New Zealand",
'126'=>"Nicaragua",
'127'=>"Niger",
'128'=>"Nigeria",
'129'=>"Norway",
'130'=>"Oman",
'131'=>"Pakistan",
'132'=>"Palau",
'133'=>"Panama",
'134'=>"Papua New Guinea",
'135'=>"Paraguay",
'136'=>"Peru",
'137'=>"Philippines",
'138'=>"Poland",
'139'=>"Portugal",
'140'=>"Qatar",
'141'=>"Romania",
'142'=>"Russia",
'143'=>"Rwanda",
'144'=>"Saint Kitts and Nevis",
'145'=>"Saint Lucia",
'146'=>"Saint Vincent",
'147'=>"Samoa",
'148'=>"San Marino",
'149'=>"Sao Tome and Principe",
'150'=>"Saudi Arabia",
'151'=>"Senegal",
'152'=>"Serbia and Montenegro",
'153'=>"Seychelles",
'154'=>"Sierra Leone",
'155'=>"Singapore",
'156'=>"Slovakia",
'157'=>"Slovenia",
'158'=>"Solomon Islands",
'159'=>"Somalia",
'160'=>"South Africa",
'161'=>"Spain",
'162'=>"Sri Lanka",
'163'=>"Sudan",
'164'=>"Suriname",
'165'=>"Swaziland",
'166'=>"Sweden",
'167'=>"Switzerland",
'168'=>"Syria",
'169'=>"Taiwan",
'170'=>"Tajikistan",
'171'=>"Tanzania",
'172'=>"Thailand",
'173'=>"Togo",
'174'=>"Tonga",
'175'=>"Trinidad and Tobago",
'176'=>"Tunisia",
'177'=>"Turkey",
'178'=>"Turkmenistan",
'179'=>"Tuvalu",
'180'=>"Uganda",
'181'=>"Ukraine",
'182'=>"United Arab Emirates",
'183'=>"United Kingdom",
'184'=>"United States",
'185'=>"Uruguay",
'186'=>"Uzbekistan",
'187'=>"Vanuatu",
'188'=>"Vatican City",
'189'=>"Venezuela",
'190'=>"Vietnam",
'191'=>"Yemen",
'192'=>"Zambia",
'193'=>"Zimbabwe"
);

bala.nita09 (14-11-2009 14:51) :
Just what I wanted. Special Thanks goes to 'ALoses' since his/her version is the one i copied. But ALoses' version can be generated on our own by just using foreach loop. Thanks all folks!

Nowaker (21-11-2009 19:51) :
Under which license do you publish this code? I know that everyone can create the same array but I copy this one I need a license.

Nowaker (21-11-2009 19:55) :
Under what license do you publish this list?

i guess im right (07-12-2009 06:40) :
Surely its a free :D

Pavel (21-12-2009 14:06) :
Guys, here is the list of countries with dialing codes!

'Afghanistan' => '93',
'Albania' => '355',
'Algeria' => '213',
'American Samoa' => '1 684',
'Andorra' => '376',
'Angola' => '244',
'Anguilla' => '1264',
'Antarctica' => '672',
'Antigua and Barbuda' => '1268',
'Antilles, Netherlands' => '599',
'Argentina' => '54',
'Armenia' => '374',
'Aruba' => '297',
'Australia' => '61',
'Austria' => '43',
'Azerbaijan' => '994',
'Bahamas' => '1242',
'Bahrain' => '973',
'Bangladesh' => '880',
'Barbados' => '1246',
'Belarus' => '375',
'Belgium' => '375',
'Belize' => '501',
'Benin' => '229',
'Bermuda' => '1 441',
'Bhutan' => '975',
'Bolivia' => '591',
'Bosnia and Herzegovina' => '387',
'Botswana' => '267',
'Brazil' => '55',
'British Indian Ocean Territory' => '246',
'British Virgin Islands' => '1 284',
'Brunei Darussalam' => '673',
'Bulgaria' => '359',
'Burkina Faso' => '226',
'Burundi' => '257',
'Cambodia' => '855',
'Cameroon' => '237',
'Canada' => '1',
'Cape Verde' => '238',
'Cayman Islands' => '1 345',
'Central African Republic' => '236',
'Chad' => '235',
'Chile' => '56',
'China' => '86',
'Christmas Island' => '64',
'Cocos (Keeling) Islands' => '61',
'Colombia' => '57',
'Comoros' => '269',
'Congo' => '242',
'Cook Islands' => '682',
'Costa Rica' => '506',
'Cote D\'Ivoire' => '225',
'Croatia' => '385',
'Cuba' => '53',
'Cyprus' => '357',
'Czech Republic' => '420',
'Denmark' => '45',
'Djibouti' => '253',
'Dominica' => '1 767',
'Dominican Republic' => '1 809',
'East Timor (Timor-Leste)' => '670',
'Ecuador' => '593',
'Egypt' => '20',
'El Salvador' => '503',
'Equatorial Guinea' => '240',
'Eritrea' => '291',
'Estonia' => '372',
'Ethiopia' => '251',
'Falkland Islands (Malvinas)' => '500',
'Faroe Islands' => '298',
'Fiji' => '679',
'Finland' => '358',
'France' => '33',
'French Guiana' => '594',
'French Polynesia' => '689',
'Gabon' => '241',
'Gambia, the' => '220',
'Georgia' => '995',
'Germany' => '49',
'Ghana' => '233',
'Gibraltar' => '350',
'Greece' => '30',
'Greenland' => '299',
'Grenada' => '1 473',
'Guadeloupe' => '590',
'Guam' => '1 671',
'Guatemala' => '502',
'Guernsey and Alderney' => '5399',
'Guinea' => '224',
'Guinea-Bissau' => '245',
'Guinea, Equatorial' => '240',
'Guiana, French' => '594',
'Guyana' => '592',
'Haiti' => '509',
'Holy See (Vatican City State)' => '379',
'Holland' => '31',
'Honduras' => '504',
'Hong Kong, (China)' => '852',
'Hungary' => '36',
'Iceland' => '354',
'India' => '91',
'Indonesia' => '62',
'Iran' => '98',
'Iraq' => '964',
'Ireland' => '353',
'Isle of Man' => '44',
'Israel' => '972',
'Italy' => '39',
'Jamaica' => '1 876',
'Japan' => '81',
'Jersey' => '44',
'Jordan' => '962',
'Kazakhstan' => '7',
'Kenya' => '254',
'Kiribati' => '686',
'Korea(North)' => '850',
'Korea(South)' => '82',
'Kosovo' => '381',
'Kuwait' => '965',
'Kyrgyzstan' => '996',
'Lao People\'s Democratic Republic' => '856',
'Latvia' => '371',
'Lebanon' => '961',
'Lesotho' => '266',
'Liberia' => '231',
'Libyan Arab Jamahiriya' => '218',
'Liechtenstein' => '423',
'Lithuania' => '370',
'Luxembourg' => '352',
'Macao, (China)' => '853',
'Macedonia, TFYR' => '389',
'Madagascar' => '261',
'Malawi' => '265',
'Malaysia' => '60',
'Maldives' => '960',
'Mali' => '223',
'Malta' => '356',
'Marshall Islands' => '692',
'Martinique' => '596',
'Mauritania' => '222',
'Mauritius' => '230',
'Mayotte' => '262',
'Mexico' => '52',
'Micronesia' => '691',
'Moldova' => '373',
'Monaco' => '377',
'Mongolia' => '976',
'Montenegro' => '382',
'Montserrat' => '1 664',
'Morocco' => '212',
'Mozambique' => '258',
'Myanmar' => '95',
'Namibia' => '264',
'Nauru' => '674',
'Nepal' => '977',
'Netherlands' => '31',
'Netherlands Antilles' => '599',
'New Caledonia' => '687',
'New Zealand' => '64',
'Nicaragua' => '505',
'Niger' => '227',
'Nigeria' => '234',
'Niue' => '683',
'Norfolk Island' => '672',
'Northern Mariana Islands' => '1 670',
'Norway' => '47',
'Oman' => '968',
'Pakistan' => '92',
'Palau' => '680',
'Palestinian Territory' => '970',
'Panama' => '507',
'Papua New Guinea' => '675',
'Paraguay' => '595',
'Peru' => '51',
'Philippines' => '63',
'Pitcairn Island' => '872',
'Poland' => '48',
'Portugal' => '351',
'Puerto Rico' => '1787',
'Qatar' => '974',
'Reunion' => '262',
'Romania' => '40',
'Russia' => '7',
'Rwanda' => '250',
'Sahara' => '212',
'Saint Helena' => '290',
'Saint Kitts and Nevis' => '1869',
'Saint Lucia' => '1758',
'Saint Pierre and Miquelon' => '508',
'Saint Vincent and the Grenadines' => '1784',
'Samoa' => '685',
'San Marino' => '374',
'Sao Tome and Principe' => '239',
'Saudi Arabia' => '966',
'Senegal' => '221',
'Serbia' => '381',
'Seychelles' => '248',
'Sierra Leone' => '232',
'Singapore' => '65',
'Slovakia' => '421',
'Slovenia' => '386',
'Solomon Islands' => '677',
'Somalia' => '252',
'South Africa' => '27',
'S. Georgia and S. Sandwich Is.' => '500',
'Spain' => '34',
'Sri Lanka (ex-Ceilan)' => '94',
'Sudan' => '249',
'Suriname' => '597',
'Svalbard and Jan Mayen Islands' => '79',
'Swaziland' => '41',
'Sweden' => '46',
'Switzerland' => '41',
'Syrian Arab Republic' => '963',
'Taiwan' => '886',
'Tajikistan' => '992',
'Tanzania' => '255',
'Thailand' => '66',
'Timor-Leste (East Timor)' => '670',
'Togo' => '228',
'Tokelau' => '690',
'Tonga' => '676',
'Trinidad and Tobago' => '1 868',
'Tunisia' => '216',
'Turkey' => '90',
'Turkmenistan' => '993',
'Turks and Caicos Islands' => '1 649',
'Tuvalu' => '688',
'Uganda' => '256',
'Ukraine' => '380',
'United Arab Emirates' => '971',
'United Kingdom' => '44',
'United States' => '1',
'US Minor Outlying Islands' => '808',
'Uruguay' => '598',
'Uzbekistan' => '998',
'Vanuatu' => '678',
'Vatican City State (Holy See)' => '379',
'Venezuela' => '58',
'Viet Nam' => '84',
'Virgin Islands, British' => '1284',
'Virgin Islands, U.S.' => '1340',
'Wallis and Futuna' => '681',
'Western Sahara' => '212',
'Yemen' => '967',
'Zambia' => '260',
'Zimbabwe' => '263',

Salman sohail (10-03-2010 14:25) :
thanks alot you have saved my time thanks once again

nerkn (08-04-2010 14:45) :
Pavel's code is much better. I'll use that with foreach to build selec element,
kazakistan and russia seems same dial code.
Perhaps best way is to keep in varchar format

Anonymous (26-05-2010 09:15) :
Useful. Thanks

Saman (31-07-2010 00:58) :
See the array at http://www.expertcore.org/viewtopic.php?f=67&t=188 which has short country code as well.

(11-11-2010 08:56) :
TKS

Rajveer Singh (20-11-2010 14:38) :
thanks a lot...mein preshan ho geya tha dundh hue esko...thanks very much again..but now i want districts list of india ..plz help me

Edvinas (17-01-2011 11:43) :
Much easier to read list:
<?php
$country_list = array(
"Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia",
"Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium",
"Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria",
"Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad",
"Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia",
"Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)",
"Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France",
"Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau",
"Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel",
"Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait",
"Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg",
"Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania",
"Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia",
"Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau",
"Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia",
"Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe",
"Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia",
"Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden",
"Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago",
"Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom",
"United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"
);
?>

Yogesh (03-03-2011 08:54) :
I have created the list with the same key and value. May be somebody need this.

$countrylist = array(
"Afghanistan"=>"Afghanistan",
"Albania"=>"Albania",
"Algeria"=>"Algeria",
"Algeria"=>"Algeria",
"Algeria"=>"Algeria",
"Antigua and Barbuda"=>"Antigua and Barbuda",
"Argentina"=>"Argentina",
"Armenia"=>"Armenia",
"Australia"=>"Australia",
"Austria"=>"Austria",
"Azerbaijan"=>"Azerbaijan",
"Bahamas"=>"Bahamas",
"Bahrain"=>"Bahrain",
"Bangladesh"=>"Bangladesh",
"Barbados"=>"Barbados",
"Belarus"=>"Belarus",
"Belgium"=>"Belgium",
"Belize"=>"Belize",
"Benin"=>"Benin",
"Bhutan"=>"Bhutan",
"Bolivia"=>"Bolivia",
"Bosnia and Herzegovina"=>"Bosnia and Herzegovina",
"Botswana"=>"Botswana",
"Brazil"=>"Brazil",
"Brunei"=>"Brunei",
"Bulgaria"=>"Bulgaria",
"Burkina Faso"=>"Burkina Faso",
"Burundi"=>"Burundi",
"Cambodia"=>"Cambodia",
"Cameroon"=>"Cameroon",
"Canada"=>"Canada",
"Cape Verde"=>"Cape Verde",
"Central African Republic"=>"Central African Republic",
"Chad"=>"Chad",
"Chile"=>"Chile",
"China"=>"China",
"Colombi"=>"Colombi",
"Comoros"=>"Comoros",
"Congo (Brazzaville)"=>"Congo (Brazzaville)",
"Congo"=>"Congo",
"Costa Rica"=>"Costa Rica",
"Cote d'Ivoire"=>"Cote d'Ivoire",
"Croatia"=>"Croatia",
"Cuba"=>"Cuba",
"Cyprus"=>"Cyprus",
"Czech Republic"=>"Czech Republic",
"Denmark"=>"Denmark",
"Djibouti"=>"Djibouti",
"Dominica"=>"Dominica",
"Dominican Republic"=>"Dominican Republic",
"East Timor (Timor Timur)"=>"East Timor (Timor Timur)",
"Ecuador"=>"Ecuador",
"Egypt"=>"Egypt",
"El Salvador"=>"El Salvador",
"Equatorial Guinea"=>"Equatorial Guinea",
"Eritrea"=>"Eritrea",
"Estonia"=>"Estonia",
"Ethiopia"=>"Ethiopia",
"Fiji"=>"Fiji",
"Finland"=>"Finland",
"France"=>"France",
"Gabon"=>"Gabon",
"Gambia, The"=>"Gambia, The",
"Georgia"=>"Georgia",
"Germany"=>"Germany",
"Ghana"=>"Ghana",
"Greece"=>"Greece",
"Grenada"=>"Grenada",
"Guatemala"=>"Guatemala",
"Guinea"=>"Guinea",
"Guinea-Bissau"=>"Guinea-Bissau",
"Guyana"=>"Guyana",
"Haiti"=>"Haiti",
"Honduras"=>"Honduras",
"Hungary"=>"Hungary",
"Iceland"=>"Iceland",
"India"=>"India",
"Indonesia"=>"Indonesia",
"Iran"=>"Iran",
"Iraq"=>"Iraq",
"Ireland"=>"Ireland",
"Israel"=>"Israel",
"Italy"=>"Italy",
"Jamaica"=>"Jamaica",
"Japan"=>"Japan",
"Jordan"=>"Jordan",
"Kazakhstan"=>"Kazakhstan",
"Kenya"=>"Kenya",
"Kiribati"=>"Kiribati",
"Korea, North"=>"Korea, North",
"Korea, South"=>"Korea, South",
"Kuwait"=>"Kuwait",
"Kyrgyzstan"=>"Kyrgyzstan",
"Laos"=>"Laos",
"Latvia"=>"Latvia",
"Lebanon"=>"Lebanon",
"Lesotho"=>"Lesotho",
"Liberia"=>"Liberia",
"Libya"=>"Libya",
"Liechtenstein"=>"Liechtenstein",
"Lithuania"=>"Lithuania",
"Luxembourg"=>"Luxembourg",
"Macedonia"=>"Macedonia",
"Madagascar"=>"Madagascar",
"Malawi"=>"Malawi",
"Malaysia"=>"Malaysia",
"Maldives"=>"Maldives",
"Mali"=>"Mali",
"Malta"=>"Malta",
"Marshall Islands"=>"Marshall Islands",
"Mauritania"=>"Mauritania",
"Mauritius"=>"Mauritius",
"Mexico"=>"Mexico",
"Micronesia"=>"Micronesia",
"Moldova"=>"Moldova",
"Monaco"=>"Monaco",
"Mongolia"=>"Mongolia",
"Morocco"=>"Morocco",
"Mozambique"=>"Mozambique",
"Myanmar"=>"Myanmar",
"Namibia"=>"Namibia",
"Nauru"=>"Nauru",
"Nepa"=>"Nepa",
"Netherlands"=>"Netherlands",
"New Zealand"=>"New Zealand",
"Nicaragua"=>"Nicaragua",
"Niger"=>"Niger",
"Nigeria"=>"Nigeria",
"Norway"=>"Norway",
"Oman"=>"Oman",
"Pakistan"=>"Pakistan",
"Palau"=>"Palau",
"Panama"=>"Panama",
"Papua New Guinea"=>"Papua New Guinea",
"Paraguay"=>"Paraguay",
"Peru"=>"Peru",
"Philippines"=>"Philippines",
"Poland"=>"Poland",
"Portugal"=>"Portugal",
"Qatar"=>"Qatar",
"Romania"=>"Romania",
"Russia"=>"Russia",
"Rwanda"=>"Rwanda",
"Saint Kitts and Nevis"=>"Saint Kitts and Nevis",
"Saint Lucia"=>"Saint Lucia",
"Saint Vincent"=>"Saint Vincent",
"Samoa"=>"Samoa",
"San Marino"=>"San Marino",
"Sao Tome and Principe"=>"Sao Tome and Principe",
"Saudi Arabia"=>"Saudi Arabia",
"Senegal"=>"Senegal",
"Serbia and Montenegro"=>"Serbia and Montenegro",
"Seychelles"=>"Seychelles",
"Sierra Leone"=>"Sierra Leone",
"Singapore"=>"Singapore",
"Slovakia"=>"Slovakia",
"Slovenia"=>"Slovenia",
"Solomon Islands"=>"Solomon Islands",
"Somalia"=>"Somalia",
"South Africa"=>"South Africa",
"Spain"=>"Spain",
"Sri Lanka"=>"Sri Lanka",
"Sudan"=>"Sudan",
"Suriname"=>"Suriname",
"Swaziland"=>"Swaziland",
"Sweden"=>"Sweden",
"Switzerland"=>"Switzerland",
"Syria"=>"Syria",
"Taiwan"=>"Taiwan",
"Tajikistan"=>"Tajikistan",
"Tanzania"=>"Tanzania",
"Thailand"=>"Thailand",
"Togo"=>"Togo",
"Tonga"=>"Tonga",
"Trinidad and Tobago"=>"Trinidad and Tobago",
"Tunisia"=>"Tunisia",
"Turkey"=>"Turkey",
"Turkmenistan"=>"Turkmenistan",
"Tuvalu"=>"Tuvalu",
"Uganda"=>"Uganda",
"Ukraine"=>"Ukraine",
"United Arab Emirates"=>"United Arab Emirates",
"United Kingdom"=>"United Kingdom",
"United States"=>"United States",
"Uruguay"=>"Uruguay",
"Uzbekistan"=>"Uzbekistan",
"Vanuatu"=>"Vanuatu",
"Vatican City"=>"Vatican City",
"Venezuela"=>"Venezuela",
"Vietnam"=>"Vietnam",
"Yemen"=>"Yemen",
"Zambia"=>"Zambia",
"Zimbabwe"=>"Zimbabwe"
);

@...FiremonkeyBE (15-05-2011 13:47) :
List with continents

<?php

$country_array = array(

'Africa'=> array(

'DZ'=>'Algeria',
'AO'=>'Angola',
'BJ'=>'Benin',
'BW'=>'Botswana',
'BF'=>'Burkina Faso',
'BI'=>'Burundi',
'CM'=>'Cameroon',
'CV'=>'Cape Verde',
'CF'=>'Central African Republic',
'TD'=>'Chad',
'KM'=>'Comoros',
'CD'=>'Congo [DRC]',
'CG'=>'Congo [Republic]',
'DJ'=>'Djibouti',
'EG'=>'Egypt',
'GQ'=>'Equatorial Guinea',
'ER'=>'Eritrea',
'ET'=>'Ethiopia',
'GA'=>'Gabon',
'GM'=>'Gambia',
'GH'=>'Ghana',
'GN'=>'Guinea',
'GW'=>'Guinea-Bissau',
'CI'=>'Ivory Coast',
'KE'=>'Kenya',
'LS'=>'Lesotho',
'LR'=>'Liberia',
'LY'=>'Libya',
'MG'=>'Madagascar',
'MW'=>'Malawi',
'ML'=>'Mali',
'MR'=>'Mauritania',
'MU'=>'Mauritius',
'YT'=>'Mayotte',
'MA'=>'Morocco',
'MZ'=>'Mozambique',
'NA'=>'Namibia',
'NE'=>'Niger',
'NG'=>'Nigeria',
'RW'=>'Rwanda',
'RE'=>'Réunion',
'SH'=>'Saint Helena',
'SN'=>'Senegal',
'SC'=>'Seychelles',
'SL'=>'Sierra Leone',
'SO'=>'Somalia',
'ZA'=>'South Africa',
'SD'=>'Sudan',
'SZ'=>'Swaziland',
'ST'=>'São Tomé and Príncipe',
'TZ'=>'Tanzania',
'TG'=>'Togo',
'TN'=>'Tunisia',
'UG'=>'Uganda',
'EH'=>'Western Sahara',
'ZM'=>'Zambia',
'ZW'=>'Zimbabwe'),

'Antarctica'=> array(

'AQ'=>'Antarctica',
'BV'=>'Bouvet Island',
'TF'=>'French Southern Territories',
'HM'=>'Heard Island and McDonald Island',
'GS'=>'South Georgia and the South Sandwich Islands'),

'Asia'=> array(

'AF'=>'Afghanistan',
'AM'=>'Armenia',
'AZ'=>'Azerbaijan',
'BH'=>'Bahrain',
'BD'=>'Bangladesh',
'BT'=>'Bhutan',
'IO'=>'British Indian Ocean Territory',
'BN'=>'Brunei',
'KH'=>'Cambodia',
'CN'=>'China',
'CX'=>'Christmas Island',
'CC'=>'Cocos [Keeling] Islands',
'GE'=>'Georgia',
'HK'=>'Hong Kong',
'IN'=>'India',
'ID'=>'Indonesia',
'IR'=>'Iran',
'IQ'=>'Iraq',
'IL'=>'Israel',
'JP'=>'Japan',
'JO'=>'Jordan',
'KZ'=>'Kazakhstan',
'KW'=>'Kuwait',
'KG'=>'Kyrgyzstan',
'LA'=>'Laos',
'LB'=>'Lebanon',
'MO'=>'Macau',
'MY'=>'Malaysia',
'MV'=>'Maldives',
'MN'=>'Mongolia',
'MM'=>'Myanmar [Burma]',
'NP'=>'Nepal',
'KP'=>'North Korea',
'OM'=>'Oman',
'PK'=>'Pakistan',
'PS'=>'Palestinian Territories',
'PH'=>'Philippines',
'QA'=>'Qatar',
'SA'=>'Saudi Arabia',
'SG'=>'Singapore',
'KR'=>'South Korea',
'LK'=>'Sri Lanka',
'SY'=>'Syria',
'TW'=>'Taiwan',
'TJ'=>'Tajikistan',
'TH'=>'Thailand',
'TR'=>'Turkey',
'TM'=>'Turkmenistan',
'AE'=>'United Arab Emirates',
'UZ'=>'Uzbekistan',
'VN'=>'Vietnam',
'YE'=>'Yemen'),

'Europe'=>array(

'AL'=>'Albania',
'AD'=>'Andorra',
'AT'=>'Austria',
'BY'=>'Belarus',
'BE'=>'Belgium',
'BA'=>'Bosnia and Herzegovina',
'BG'=>'Bulgaria',
'HR'=>'Croatia',
'CY'=>'Cyprus',
'CZ'=>'Czech Republic',
'DK'=>'Denmark',
'EE'=>'Estonia',
'FO'=>'Faroe Islands',
'FI'=>'Finland',
'FR'=>'France',
'DE'=>'Germany',
'GI'=>'Gibraltar',
'GR'=>'Greece',
'GG'=>'Guernsey',
'HU'=>'Hungary',
'IS'=>'Iceland',
'IE'=>'Ireland',
'IM'=>'Isle of Man',
'IT'=>'Italy',
'JE'=>'Jersey',
'XK'=>'Kosovo',
'LV'=>'Latvia',
'LI'=>'Liechtenstein',
'LT'=>'Lithuania',
'LU'=>'Luxembourg',
'MK'=>'Macedonia',
'MT'=>'Malta',
'MD'=>'Moldova',
'MC'=>'Monaco',
'ME'=>'Montenegro',
'NL'=>'Netherlands',
'NO'=>'Norway',
'PL'=>'Poland',
'PT'=>'Portugal',
'RO'=>'Romania',
'RU'=>'Russia',
'SM'=>'San Marino',
'RS'=>'Serbia',
'CS'=>'Serbia and Montenegro',
'SK'=>'Slovakia',
'SI'=>'Slovenia',
'ES'=>'Spain',
'SJ'=>'Svalbard and Jan Mayen',
'SE'=>'Sweden',
'CH'=>'Switzerland',
'UA'=>'Ukraine',
'GB'=>'United Kingdom',
'VA'=>'Vatican City',
'AX'=>'Åland Islands'),

'North America'=>array(

'AI'=>'Anguilla',
'AG'=>'Antigua and Barbuda',
'AW'=>'Aruba',
'BS'=>'Bahamas',
'BB'=>'Barbados',
'BZ'=>'Belize',
'BM'=>'Bermuda',
'BQ'=>'Bonaire, Saint Eustatius and Saba',
'VG'=>'British Virgin Islands',
'CA'=>'Canada',
'KY'=>'Cayman Islands',
'CR'=>'Costa Rica',
'CU'=>'Cuba',
'CW'=>'Curacao',
'DM'=>'Dominica',
'DO'=>'Dominican Republic',
'SV'=>'El Salvador',
'GL'=>'Greenland',
'GD'=>'Grenada',
'GP'=>'Guadeloupe',
'GT'=>'Guatemala',
'HT'=>'Haiti',
'HN'=>'Honduras',
'JM'=>'Jamaica',
'MQ'=>'Martinique',
'MX'=>'Mexico',
'MS'=>'Montserrat',
'AN'=>'Netherlands Antilles',
'NI'=>'Nicaragua',
'PA'=>'Panama',
'PR'=>'Puerto Rico',
'BL'=>'Saint Barthélemy',
'KN'=>'Saint Kitts and Nevis',
'LC'=>'Saint Lucia',
'MF'=>'Saint Martin',
'PM'=>'Saint Pierre and Miquelon',
'VC'=>'Saint Vincent and the Grenadines',
'SX'=>'Sint Maarten',
'TT'=>'Trinidad and Tobago',
'TC'=>'Turks and Caicos Islands',
'VI'=>'U.S. Virgin Islands',
'US'=>'United States'),

'South America'=>array(

'AR'=>'Argentina',
'BO'=>'Bolivia',
'BR'=>'Brazil',
'CL'=>'Chile',
'CO'=>'Colombia',
'EC'=>'Ecuador',
'FK'=>'Falkland Islands',
'GF'=>'French Guiana',
'GY'=>'Guyana',
'PY'=>'Paraguay',
'PE'=>'Peru',
'SR'=>'Suriname',
'UY'=>'Uruguay',
'VE'=>'Venezuela'),

'Oceania'=>array(

'AS'=>'American Samoa',
'AU'=>'Australia',
'CK'=>'Cook Islands',
'TL'=>'East Timor',
'FJ'=>'Fiji',
'PF'=>'French Polynesia',
'GU'=>'Guam',
'KI'=>'Kiribati',
'MH'=>'Marshall Islands',
'FM'=>'Micronesia',
'NR'=>'Nauru',
'NC'=>'New Caledonia',
'NZ'=>'New Zealand',
'NU'=>'Niue',
'NF'=>'Norfolk Island',
'MP'=>'Northern Mariana Islands',
'PW'=>'Palau',
'PG'=>'Papua New Guinea',
'PN'=>'Pitcairn Islands',
'WS'=>'Samoa',
'SB'=>'Solomon Islands',
'TK'=>'Tokelau',
'TO'=>'Tonga',
'TV'=>'Tuvalu',
'UM'=>'U.S. Minor Outlying Islands',
'VU'=>'Vanuatu',
'WF'=>'Wallis and Futuna'));
?>

Joakimk (28-06-2011 09:04) :
The European array, updated with some missing states (and converted to a Perl array -- but the syntax is nearly the same):

my @europa = {
'AL', #'Albania',
'AD', #'Andorra',
'AM', # Armenia
'AT', #'Austria',
'AZ', # Azerbaijan
'BY', #'Belarus',
'BE', #'Belgium',
'BA', #'Bosnia and Herzegovina',
'BG', #'Bulgaria',
'HR', #'Croatia',
'CY', #'Cyprus',
'CZ', #'Czech Republic',
'DK', #'Denmark',
'EE', #'Estonia',
'FO', #'Faroe Islands',
'FI', #'Finland',
'FR', #'France',
'GE', # Georgia
'DE', #'Germany',
'GI', #'Gibraltar',
'GR', #'Greece',
'GG', #'Guernsey',
'HU', #'Hungary',
'IS', #'Iceland',
'IE', #'Ireland',
'IM', #'Isle of Man',
'IT', #'Italy',
'JE', #'Jersey',
'KZ', # Kazakhstan
'XK', #'Kosovo',
'LV', #'Latvia',
'LI', #'Liechtenstein',
'LT', #'Lithuania',
'LU', #'Luxembourg',
'MK', #'Macedonia',
'MT', #'Malta',
'MD', #'Moldova',
'MC', #'Monaco',
'ME', #'Montenegro',
'NL', #'Netherlands',
'NO', #'Norway',
'PL', #'Poland',
'PT', #'Portugal',
'RO', #'Romania',
'RU', #'Russia',
'SM', #'San Marino',
'RS', #'Serbia',
'SK', #'Slovakia',
'SI', #'Slovenia',
'ES', #'Spain',
'SJ', #'Svalbard and Jan Mayen',
'SE', #'Sweden',
'CH', #'Switzerland',
'TR', # Turkey
'UA', #'Ukraine',
'GB', #'United Kingdom',
'VA', #'Vatican City',
'AX' #'Åland Islands'),
};

Mike (26-07-2011 16:06) :
Thanks :)

Ryan (21-09-2011 22:14) :
Yess thank you very much!

Eric Warnke (10-10-2011 08:31) :
Beautiful :) Cheers!

Deele (07-12-2011 01:16) :
Here, I did this based on @...FiremonkeyBE data :)

/**
* Returns array with country codes
* @param stirng $zone Country zone, optional
* @param stirng $code Specific country code (to get country name), optional
* @return array Where keys are country codes and values are country names in english
*/
function countryCodeArray($zone = 'all', $code = '') {
$returnData = false;
$country_array = array(
'Africa'=> array( 'DZ'=>'Algeria', 'AO'=>'Angola', 'BJ'=>'Benin', 'BW'=>'Botswana', 'BF'=>'Burkina Faso', 'BI'=>'Burundi', 'CM'=>'Cameroon', 'CV'=>'Cape Verde', 'CF'=>'Central African Republic', 'TD'=>'Chad', 'KM'=>'Comoros', 'CD'=>'Congo [DRC]', 'CG'=>'Congo [Republic]', 'DJ'=>'Djibouti', 'EG'=>'Egypt', 'GQ'=>'Equatorial Guinea', 'ER'=>'Eritrea', 'ET'=>'Ethiopia', 'GA'=>'Gabon', 'GM'=>'Gambia', 'GH'=>'Ghana', 'GN'=>'Guinea', 'GW'=>'Guinea-Bissau', 'CI'=>'Ivory Coast', 'KE'=>'Kenya', 'LS'=>'Lesotho', 'LR'=>'Liberia', 'LY'=>'Libya', 'MG'=>'Madagascar', 'MW'=>'Malawi', 'ML'=>'Mali', 'MR'=>'Mauritania', 'MU'=>'Mauritius', 'YT'=>'Mayotte', 'MA'=>'Morocco', 'MZ'=>'Mozambique', 'NA'=>'Namibia', 'NE'=>'Niger', 'NG'=>'Nigeria', 'RW'=>'Rwanda', 'RE'=>'Réunion', 'SH'=>'Saint Helena', 'SN'=>'Senegal', 'SC'=>'Seychelles', 'SL'=>'Sierra Leone', 'SO'=>'Somalia', 'ZA'=>'South Africa', 'SD'=>'Sudan', 'SZ'=>'Swaziland', 'ST'=>'São Tomé and Pr?ncipe', 'TZ'=>'Tanzania', 'TG'=>'Togo', 'TN'=>'Tunisia', 'UG'=>'Uganda', 'EH'=>'Western Sahara', 'ZM'=>'Zambia', 'ZW'=>'Zimbabwe'),
'Antarctica'=> array( 'AQ'=>'Antarctica', 'BV'=>'Bouvet Island', 'TF'=>'French Southern Territories', 'HM'=>'Heard Island and McDonald Island', 'GS'=>'South Georgia and the South Sandwich Islands'),
'Asia'=> array( 'AF'=>'Afghanistan', 'AM'=>'Armenia', 'AZ'=>'Azerbaijan', 'BH'=>'Bahrain', 'BD'=>'Bangladesh', 'BT'=>'Bhutan', 'IO'=>'British Indian Ocean Territory', 'BN'=>'Brunei', 'KH'=>'Cambodia', 'CN'=>'China', 'CX'=>'Christmas Island', 'CC'=>'Cocos [Keeling] Islands', 'GE'=>'Georgia', 'HK'=>'Hong Kong', 'IN'=>'India', 'ID'=>'Indonesia', 'IR'=>'Iran', 'IQ'=>'Iraq', 'IL'=>'Israel', 'JP'=>'Japan', 'JO'=>'Jordan', 'KZ'=>'Kazakhstan', 'KW'=>'Kuwait', 'KG'=>'Kyrgyzstan', 'LA'=>'Laos', 'LB'=>'Lebanon', 'MO'=>'Macau', 'MY'=>'Malaysia', 'MV'=>'Maldives', 'MN'=>'Mongolia', 'MM'=>'Myanmar [Burma]', 'NP'=>'Nepal', 'KP'=>'North Korea', 'OM'=>'Oman', 'PK'=>'Pakistan', 'PS'=>'Palestinian Territories', 'PH'=>'Philippines', 'QA'=>'Qatar', 'SA'=>'Saudi Arabia', 'SG'=>'Singapore', 'KR'=>'South Korea', 'LK'=>'Sri Lanka', 'SY'=>'Syria', 'TW'=>'Taiwan', 'TJ'=>'Tajikistan', 'TH'=>'Thailand', 'TR'=>'Turkey', 'TM'=>'Turkmenistan', 'AE'=>'United Arab Emirates', 'UZ'=>'Uzbekistan', 'VN'=>'Vietnam', 'YE'=>'Yemen'),
'Europe'=>array( 'AL'=>'Albania', 'AD'=>'Andorra', 'AT'=>'Austria', 'BY'=>'Belarus', 'BE'=>'Belgium', 'BA'=>'Bosnia and Herzegovina', 'BG'=>'Bulgaria', 'HR'=>'Croatia', 'CY'=>'Cyprus', 'CZ'=>'Czech Republic', 'DK'=>'Denmark', 'EE'=>'Estonia', 'FO'=>'Faroe Islands', 'FI'=>'Finland', 'FR'=>'France', 'DE'=>'Germany', 'GI'=>'Gibraltar', 'GR'=>'Greece', 'GG'=>'Guernsey', 'HU'=>'Hungary', 'IS'=>'Iceland', 'IE'=>'Ireland', 'IM'=>'Isle of Man', 'IT'=>'Italy', 'JE'=>'Jersey', 'XK'=>'Kosovo', 'LV'=>'Latvia', 'LI'=>'Liechtenstein', 'LT'=>'Lithuania', 'LU'=>'Luxembourg', 'MK'=>'Macedonia', 'MT'=>'Malta', 'MD'=>'Moldova', 'MC'=>'Monaco', 'ME'=>'Montenegro', 'NL'=>'Netherlands', 'NO'=>'Norway', 'PL'=>'Poland', 'PT'=>'Portugal', 'RO'=>'Romania', 'RU'=>'Russia', 'SM'=>'San Marino', 'RS'=>'Serbia', 'CS'=>'Serbia and Montenegro', 'SK'=>'Slovakia', 'SI'=>'Slovenia', 'ES'=>'Spain', 'SJ'=>'Svalbard and Jan Mayen', 'SE'=>'Sweden', 'CH'=>'Switzerland', 'UA'=>'Ukraine', 'GB'=>'United Kingdom', 'VA'=>'Vatican City', 'AX'=>'Åland Islands'),
'North America'=>array( 'AI'=>'Anguilla', 'AG'=>'Antigua and Barbuda', 'AW'=>'Aruba', 'BS'=>'Bahamas', 'BB'=>'Barbados', 'BZ'=>'Belize', 'BM'=>'Bermuda', 'BQ'=>'Bonaire, Saint Eustatius and Saba', 'VG'=>'British Virgin Islands', 'CA'=>'Canada', 'KY'=>'Cayman Islands', 'CR'=>'Costa Rica', 'CU'=>'Cuba', 'CW'=>'Curacao', 'DM'=>'Dominica', 'DO'=>'Dominican Republic', 'SV'=>'El Salvador', 'GL'=>'Greenland', 'GD'=>'Grenada', 'GP'=>'Guadeloupe', 'GT'=>'Guatemala', 'HT'=>'Haiti', 'HN'=>'Honduras', 'JM'=>'Jamaica', 'MQ'=>'Martinique', 'MX'=>'Mexico', 'MS'=>'Montserrat', 'AN'=>'Netherlands Antilles', 'NI'=>'Nicaragua', 'PA'=>'Panama', 'PR'=>'Puerto Rico', 'BL'=>'Saint Barthélemy', 'KN'=>'Saint Kitts and Nevis', 'LC'=>'Saint Lucia', 'MF'=>'Saint Martin', 'PM'=>'Saint Pierre and Miquelon', 'VC'=>'Saint Vincent and the Grenadines', 'SX'=>'Sint Maarten', 'TT'=>'Trinidad and Tobago', 'TC'=>'Turks and Caicos Islands', 'VI'=>'U.S. Virgin Islands', 'US'=>'United States'),
'South America'=>array( 'AR'=>'Argentina', 'BO'=>'Bolivia', 'BR'=>'Brazil', 'CL'=>'Chile', 'CO'=>'Colombia', 'EC'=>'Ecuador', 'FK'=>'Falkland Islands', 'GF'=>'French Guiana', 'GY'=>'Guyana', 'PY'=>'Paraguay', 'PE'=>'Peru', 'SR'=>'Suriname', 'UY'=>'Uruguay', 'VE'=>'Venezuela'),
'Oceania'=>array( 'AS'=>'American Samoa', 'AU'=>'Australia', 'CK'=>'Cook Islands', 'TL'=>'East Timor', 'FJ'=>'Fiji', 'PF'=>'French Polynesia', 'GU'=>'Guam', 'KI'=>'Kiribati', 'MH'=>'Marshall Islands', 'FM'=>'Micronesia', 'NR'=>'Nauru', 'NC'=>'New Caledonia', 'NZ'=>'New Zealand', 'NU'=>'Niue', 'NF'=>'Norfolk Island', 'MP'=>'Northern Mariana Islands', 'PW'=>'Palau', 'PG'=>'Papua New Guinea', 'PN'=>'Pitcairn Islands', 'WS'=>'Samoa', 'SB'=>'Solomon Islands', 'TK'=>'Tokelau', 'TO'=>'Tonga', 'TV'=>'Tuvalu', 'UM'=>'U.S. Minor Outlying Islands', 'VU'=>'Vanuatu', 'WF'=>'Wallis and Futuna')
);
if ($zone == 'all') {
$returnData = $country_array;
}
elseif (isset($country_array[$zone])) {
if ($code != '') {
if (isset($country_array[$zone][$code])) {
$returnData = $country_array[$zone][$code];
}
}
else {
$returnData = $country_array[$zone];
}
}
return $returnData;
}

Izharul Haque Aazmi (11-01-2012 12:03) :
Thanks all there! Your job is incredible!

bryan (13-02-2012 00:17) :
here is my function:

function getWorldCountries() {
$countries = array( array("name"=>"Andorra", "code"=>"AD"),
array("name"=>"United Arab Emirates", "code"=>"AE"),
array("name"=>"Afghanistan", "code"=>"AF"),
array("name"=>"Antigua and Barbuda", "code"=>"AG"),
array("name"=>"Anguilla", "code"=>"AI"),
array("name"=>"Albania", "code"=>"AL"),
array("name"=>"Armenia", "code"=>"AM"),
array("name"=>"Netherlands Antilles", "code"=>"AN"),
array("name"=>"Angola", "code"=>"AO"),
array("name"=>"Asia/Pacific Region", "code"=>"AP"),
array("name"=>"Antarctica", "code"=>"AQ"),
array("name"=>"Argentina", "code"=>"AR"),
array("name"=>"American Samoa", "code"=>"AS"),
array("name"=>"Austria", "code"=>"AT"),
array("name"=>"Australia", "code"=>"AU"),
array("name"=>"Aruba", "code"=>"AW"),
array("name"=>"Aland Islands", "code"=>"AX"),
array("name"=>"Azerbaijan", "code"=>"AZ"),
array("name"=>"Bosnia and Herzegovina", "code"=>"BA"),
array("name"=>"Barbados", "code"=>"BB"),
array("name"=>"Bangladesh", "code"=>"BD"),
array("name"=>"Belgium", "code"=>"BE"),
array("name"=>"Burkina Faso", "code"=>"BF"),
array("name"=>"Bulgaria", "code"=>"BG"),
array("name"=>"Bahrain", "code"=>"BH"),
array("name"=>"Burundi", "code"=>"BI"),
array("name"=>"Benin", "code"=>"BJ"),
array("name"=>"Bermuda", "code"=>"BM"),
array("name"=>"Brunei Darussalam", "code"=>"BN"),
array("name"=>"Bolivia", "code"=>"BO"),
array("name"=>"Brazil", "code"=>"BR"),
array("name"=>"Bahamas", "code"=>"BS"),
array("name"=>"Bhutan", "code"=>"BT"),
array("name"=>"Bouvet Island", "code"=>"BV"),
array("name"=>"Botswana", "code"=>"BW"),
array("name"=>"Belarus", "code"=>"BY"),
array("name"=>"Belize", "code"=>"BZ"),
array("name"=>"Canada", "code"=>"CA"),
array("name"=>"Cocos (Keeling) Islands", "code"=>"CC"),
array("name"=>"Congo", "code"=>"CD"),
array("name"=>"Central African Republic", "code"=>"CF"),
array("name"=>"Congo", "code"=>"CG"),
array("name"=>"Switzerland", "code"=>"CH"),
array("name"=>"Cote d'Ivoire", "code"=>"CI"),
array("name"=>"Cook Islands", "code"=>"CK"),
array("name"=>"Chile", "code"=>"CL"),
array("name"=>"Cameroon", "code"=>"CM"),
array("name"=>"China", "code"=>"CN"),
array("name"=>"Colombia", "code"=>"CO"),
array("name"=>"Costa Rica", "code"=>"CR"),
array("name"=>"Cuba", "code"=>"CU"),
array("name"=>"Cape Verde", "code"=>"CV"),
array("name"=>"Christmas Island", "code"=>"CX"),
array("name"=>"Cyprus", "code"=>"CY"),
array("name"=>"Czech Republic", "code"=>"CZ"),
array("name"=>"Germany", "code"=>"DE"),
array("name"=>"Djibouti", "code"=>"DJ"),
array("name"=>"Denmark", "code"=>"DK"),
array("name"=>"Dominica", "code"=>"DM"),
array("name"=>"Dominican Republic", "code"=>"DO"),
array("name"=>"Algeria", "code"=>"DZ"),
array("name"=>"Ecuador", "code"=>"EC"),
array("name"=>"Estonia", "code"=>"EE"),
array("name"=>"Egypt", "code"=>"EG"),
array("name"=>"Western Sahara", "code"=>"EH"),
array("name"=>"Eritrea", "code"=>"ER"),
array("name"=>"Spain", "code"=>"ES"),
array("name"=>"Ethiopia", "code"=>"ET"),
array("name"=>"Europe", "code"=>"EU"),
array("name"=>"Finland", "code"=>"FI"),
array("name"=>"Fiji", "code"=>"FJ"),
array("name"=>"Falkland Islands (Malvinas)", "code"=>"FK"),
array("name"=>"Micronesia", "code"=>"FM"),
array("name"=>"Faroe Islands", "code"=>"FO"),
array("name"=>"France", "code"=>"FR"),
array("name"=>"Gabon", "code"=>"GA"),
array("name"=>"United Kingdom", "code"=>"GB"),
array("name"=>"Grenada", "code"=>"GD"),
array("name"=>"Georgia", "code"=>"GE"),
array("name"=>"French Guiana", "code"=>"GF"),
array("name"=>"Guernsey", "code"=>"GG"),
array("name"=>"Ghana", "code"=>"GH"),
array("name"=>"Gibraltar", "code"=>"GI"),
array("name"=>"Greenland", "code"=>"GL"),
array("name"=>"Gambia", "code"=>"GM"),
array("name"=>"Guinea", "code"=>"GN"),
array("name"=>"Guadeloupe", "code"=>"GP"),
array("name"=>"Equatorial Guinea", "code"=>"GQ"),
array("name"=>"Greece", "code"=>"GR"),
array("name"=>"South Georgia and the South Sandwich Islands", "code"=>"GS"),
array("name"=>"Guatemala", "code"=>"GT"),
array("name"=>"Guam", "code"=>"GU"),
array("name"=>"Guinea-Bissau", "code"=>"GW"),
array("name"=>"Guyana", "code"=>"GY"),
array("name"=>"Hong Kong", "code"=>"HK"),
array("name"=>"Heard Island and McDonald Islands", "code"=>"HM"),
array("name"=>"Honduras", "code"=>"HN"),
array("name"=>"Croatia", "code"=>"HR"),
array("name"=>"Haiti", "code"=>"HT"),
array("name"=>"Hungary", "code"=>"HU"),
array("name"=>"Indonesia", "code"=>"ID"),
array("name"=>"Ireland", "code"=>"IE"),
array("name"=>"Israel", "code"=>"IL"),
array("name"=>"Isle of Man", "code"=>"IM"),
array("name"=>"India", "code"=>"IN"),
array("name"=>"British Indian Ocean Territory", "code"=>"IO"),
array("name"=>"Iraq", "code"=>"IQ"),
array("name"=>"Iran", "code"=>"IR"),
array("name"=>"Iceland", "code"=>"IS"),
array("name"=>"Italy", "code"=>"IT"),
array("name"=>"Jersey", "code"=>"JE"),
array("name"=>"Jamaica", "code"=>"JM"),
array("name"=>"Jordan", "code"=>"JO"),
array("name"=>"Japan", "code"=>"JP"),
array("name"=>"Kenya", "code"=>"KE"),
array("name"=>"Kyrgyzstan", "code"=>"KG"),
array("name"=>"Cambodia", "code"=>"KH"),
array("name"=>"Kiribati", "code"=>"KI"),
array("name"=>"Comoros", "code"=>"KM"),
array("name"=>"Saint Kitts and Nevis", "code"=>"KN"),
array("name"=>"Korea", "code"=>"KP"),
array("name"=>"Korea", "code"=>"KR"),
array("name"=>"Kuwait", "code"=>"KW"),
array("name"=>"Cayman Islands", "code"=>"KY"),
array("name"=>"Kazakhstan", "code"=>"KZ"),
array("name"=>"Lao People's Democratic Republic", "code"=>"LA"),
array("name"=>"Lebanon", "code"=>"LB"),
array("name"=>"Saint Lucia", "code"=>"LC"),
array("name"=>"Liechtenstein", "code"=>"LI"),
array("name"=>"Sri Lanka", "code"=>"LK"),
array("name"=>"Liberia", "code"=>"LR"),
array("name"=>"Lesotho", "code"=>"LS"),
array("name"=>"Lithuania", "code"=>"LT"),
array("name"=>"Luxembourg", "code"=>"LU"),
array("name"=>"Latvia", "code"=>"LV"),
array("name"=>"Libyan Arab Jamahiriya", "code"=>"LY"),
array("name"=>"Morocco", "code"=>"MA"),
array("name"=>"Monaco", "code"=>"MC"),
array("name"=>"Moldova", "code"=>"MD"),
array("name"=>"Montenegro", "code"=>"ME"),
array("name"=>"Madagascar", "code"=>"MG"),
array("name"=>"Marshall Islands", "code"=>"MH"),
array("name"=>"Macedonia", "code"=>"MK"),
array("name"=>"Mali", "code"=>"ML"),
array("name"=>"Myanmar", "code"=>"MM"),
array("name"=>"Mongolia", "code"=>"MN"),
array("name"=>"Macao", "code"=>"MO"),
array("name"=>"Northern Mariana Islands", "code"=>"MP"),
array("name"=>"Martinique", "code"=>"MQ"),
array("name"=>"Mauritania", "code"=>"MR"),
array("name"=>"Montserrat", "code"=>"MS"),
array("name"=>"Malta", "code"=>"MT"),
array("name"=>"Mauritius", "code"=>"MU"),
array("name"=>"Maldives", "code"=>"MV"),
array("name"=>"Malawi", "code"=>"MW"),
array("name"=>"Mexico", "code"=>"MX"),
array("name"=>"Malaysia", "code"=>"MY"),
array("name"=>"Mozambique", "code"=>"MZ"),
array("name"=>"Namibia", "code"=>"NA"),
array("name"=>"New Caledonia", "code"=>"NC"),
array("name"=>"Niger", "code"=>"NE"),
array("name"=>"Norfolk Island", "code"=>"NF"),
array("name"=>"Nigeria", "code"=>"NG"),
array("name"=>"Nicaragua", "code"=>"NI"),
array("name"=>"Netherlands", "code"=>"NL"),
array("name"=>"Norway", "code"=>"NO"),
array("name"=>"Nepal", "code"=>"NP"),
array("name"=>"Nauru", "code"=>"NR"),
array("name"=>"Niue", "code"=>"NU"),
array("name"=>"New Zealand", "code"=>"NZ"),
array("name"=>"Oman", "code"=>"OM"),
array("name"=>"Panama", "code"=>"PA"),
array("name"=>"Peru", "code"=>"PE"),
array("name"=>"French Polynesia", "code"=>"PF"),
array("name"=>"Papua New Guinea", "code"=>"PG"),
array("name"=>"Philippines", "code"=>"PH"),
array("name"=>"Pakistan", "code"=>"PK"),
array("name"=>"Poland", "code"=>"PL"),
array("name"=>"Saint Pierre and Miquelon", "code"=>"PM"),
array("name"=>"Pitcairn", "code"=>"PN"),
array("name"=>"Puerto Rico", "code"=>"PR"),
array("name"=>"Palestinian Territory", "code"=>"PS"),
array("name"=>"Portugal", "code"=>"PT"),
array("name"=>"Palau", "code"=>"PW"),
array("name"=>"Paraguay", "code"=>"PY"),
array("name"=>"Qatar", "code"=>"QA"),
array("name"=>"Reunion", "code"=>"RE"),
array("name"=>"Romania", "code"=>"RO"),
array("name"=>"Serbia", "code"=>"RS"),
array("name"=>"Russian Federation", "code"=>"RU"),
array("name"=>"Rwanda", "code"=>"RW"),
array("name"=>"Saudi Arabia", "code"=>"SA"),
array("name"=>"Solomon Islands", "code"=>"SB"),
array("name"=>"Seychelles", "code"=>"SC"),
array("name"=>"Sudan", "code"=>"SD"),
array("name"=>"Sweden", "code"=>"SE"),
array("name"=>"Singapore", "code"=>"SG"),
array("name"=>"Saint Helena", "code"=>"SH"),
array("name"=>"Slovenia", "code"=>"SI"),
array("name"=>"Svalbard and Jan Mayen", "code"=>"SJ"),
array("name"=>"Slovakia", "code"=>"SK"),
array("name"=>"Sierra Leone", "code"=>"SL"),
array("name"=>"San Marino", "code"=>"SM"),
array("name"=>"Senegal", "code"=>"SN"),
array("name"=>"Somalia", "code"=>"SO"),
array("name"=>"Suriname", "code"=>"SR"),
array("name"=>"Sao Tome and Principe", "code"=>"ST"),
array("name"=>"El Salvador", "code"=>"SV"),
array("name"=>"Syrian Arab Republic", "code"=>"SY"),
array("name"=>"Swaziland", "code"=>"SZ"),
array("name"=>"Turks and Caicos Islands", "code"=>"TC"),
array("name"=>"Chad", "code"=>"TD"),
array("name"=>"French Southern Territories", "code"=>"TF"),
array("name"=>"Togo", "code"=>"TG"),
array("name"=>"Thailand", "code"=>"TH"),
array("name"=>"Tajikistan", "code"=>"TJ"),
array("name"=>"Tokelau", "code"=>"TK"),
array("name"=>"Timor-Leste", "code"=>"TL"),
array("name"=>"Turkmenistan", "code"=>"TM"),
array("name"=>"Tunisia", "code"=>"TN"),
array("name"=>"Tonga", "code"=>"TO"),
array("name"=>"Turkey", "code"=>"TR"),
array("name"=>"Trinidad and Tobago", "code"=>"TT"),
array("name"=>"Tuvalu", "code"=>"TV"),
array("name"=>"Taiwan", "code"=>"TW"),
array("name"=>"Tanzania", "code"=>"TZ"),
array("name"=>"Ukraine", "code"=>"UA"),
array("name"=>"Uganda", "code"=>"UG"),
array("name"=>"United States Minor Outlying Islands", "code"=>"UM"),
array("name"=>"United States", "code"=>"US"),
array("name"=>"Uruguay", "code"=>"UY"),
array("name"=>"Uzbekistan", "code"=>"UZ"),
array("name"=>"Holy See (Vatican City State)", "code"=>"VA"),
array("name"=>"Saint Vincent and the Grenadines", "code"=>"VC"),
array("name"=>"Venezuela", "code"=>"VE"),
array("name"=>"Virgin Islands", "code"=>"VG"),
array("name"=>"Virgin Islands", "code"=>"VI"),
array("name"=>"Vietnam", "code"=>"VN"),
array("name"=>"Vanuatu", "code"=>"VU"),
array("name"=>"Wallis and Futuna", "code"=>"WF"),
array("name"=>"Samoa", "code"=>"WS"),
array("name"=>"Yemen", "code"=>"YE"),
array("name"=>"Mayotte", "code"=>"YT"),
array("name"=>"South Africa", "code"=>"ZA"),
array("name"=>"Zambia", "code"=>"ZM"),
array("name"=>"Zimbabwe", "code"=>"ZW")
);
return $countries;
}

Ram Kumar Bhandari (06-01-2013 16:17) :
Except Pavel's array, all of other arrays has listed Nepal as "Nepa".

Back to articles list

This page was last modified on 2014-08-20 23:02:30