array-met-alle-landen

Gesponsorde koppelingen

PHP script bestanden

  1. array-met-alle-landen

« Lees de omschrijving en reacties

Je kan de array makkelijk gebruik met een for each of while loop.

While-loop:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
<?
  $i
= 0;
   while ($i <= count($country)) {
     echo $country[$i] . "<br>";
     $i++;
  }

?>


for-each loop:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
foreach($country as $value) {
   print "$value<br>";
}


Waarvoor te gebruiken?
-Bijna alle systemen die members laten registreren.

en dan nu de array:
Country.php
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?
//gewijzigd, zie comments
$country = array();
$country[0] = "Select Country";
$country[1] = "Afghanistan";
$country[2] = "Albania";
$country[3] = "Algeria";
$country[4] = "American Samoa";
$country[5] = "Andorra";
$country[6] = "Angola";
$country[7] = "Anguilla";
$country[8] = "Antarctica";
$country[9] = "Antigua and barbuda";
$country[10] = "Argentina";
$country[11] = "Armenia";
$country[12] = "Aruba";
$country[13] = "Australia";
$country[14] = "Austria";
$country[15] = "Azerbaijan";
$country[16] = "Bahamas";
$country[17] = "Bahrain";
$country[18] = "Bangladesh";
$country[19] = "Babedos";
$country[20] = "Belarus";
$country[21] = "Belgium";
$country[22] = "Belize";
$country[23] = "Benin";
$country[24] = "Bermuda";
$country[25] = "Bhutan";
$country[26] = "Bolivia";
$country[27] = "Bosnia and Herzegovina";
$country[28] = "Botswana";
$country[29] = "Bouvet Island";
$country[30] = "Brazil";
$country[31] = "British Indian Ocean Territory";
$country[32] = "Brunei Darussalam";
$country[33] = "Bulgaria";
$country[34] = "Burkina Faso";
$country[35] = "Burundi";
$country[36] = "Cambodia";
$country[37] = "Cameroon";
$country[38] = "Canada";
$country[39] = "Cape Verde";
$country[40] = "Cayman Islands";
$country[41] = "Central Africa republic";
$country[42] = "Chad";
$country[43] = "Chile";
$country[44] = "China";
$country[45] = "Christmas Island";
$country[46] = "Cocos (Keeling) Islands";
$country[47] = "Colombia";
$country[48] = "comoros";
$country[49] = "Congo";
$country[50] = "Cook Islands";
$country[51] = "costa Rica";
$country[52] = "Cote D'ivoire";
$country[53] = "Croatia";
$country[54] = "Cuba";
$country[55] = "Cyprus";
$country[56] = "Czech Republic";
$country[57] = "Denmark";
$country[58] = "Djibouti";
$country[59] = "Dominica";
$country[60] = "Dominican Republic";
$country[61] = "Ecuador";
$country[62] = "Egypt";
$country[64] = "El Salvador";
$country[65] = "Equatorial Guinea";
$country[66] = "eritrea";
$country[67] = "Estonia";
$country[68] = "Ethiopia";
$country[69] = "Falkland Islands";
$country[70] = "Faroe Islands";
$country[71] = "Fiji";
$country[72] = "Finland";
$country[73] = "France";
$country[74] = "French Guiana";
$country[75] = "French Polynesia";
$country[76] = "French Souther Territories";
$country[77] = "Gabon";
$country[78] = "Gambia";
$country[79] = "Georgia";
$country[80] = "Germany";
$country[81] = "Ghana";
$country[82] = "Gilbraltar";
$country[83] = "Greece";
$country[84] = "Greenland";
$country[85] = "Grenada";
$country[86] = "Guadeloupe";
$country[87] = "Guam";
$country[88] = "Guatemalia";
$country[89] = "Guinea";
$country[90] = "Guinea-bissau";
$country[91] = "Guyana";
$country[92] = "Haiti";
$country[93] = "Honduras";
$country[94] = "Hong Kong";
$country[95] = "Hungary";
$country[96] = "Iceland";
$country[97] = "India";
$country[98] = "Indonesia";
$country[99] = "Iran";
$country[100] = "Iraq";
$country[101] = "Ireland";
$country[102] = "Israel";
$country[103] = "Italy";
$country[104] = "Jamaica";
$country[105] = "Japan";
$country[106] = "Jordan";
$country[107] = "Kazakhstan";
$country[108] = "Kenya";
$country[109] = "Kiribati";
$country[110] = "Korea (North)";
$country[111] = "Korea (South)";
$country[112] = "Kosovo";
$country[113] = "Kuwait";
$country[114] = "Kyrgyzstan";
$country[115] = "Latvia";
$country[116] = "Lebanon";
$country[117] = "Lesotho";
$country[118] = "Liberia";
$country[119] = "Liechtenstein";
$country[120] = "Lithuania";
$country[121] = "Luxembourg";
$country[122] = "Macao";
$country[123] = "Macedonia";
$country[124] = "Madagascar";
$country[125] = "Malawi";
$country[126] = "Malysia";
$country[127] = "Maldives";
$country[128] = "Mali";
$country[129] = "Malta";
$country[130] = "Martinique";
$country[131] = "Mauritania";
$country[132] = "Mauritius";
$country[133] = "Mayotte";
$country[134] = "Mexico";
$country[135] = "Moldova";
$country[136] = "Monaco";
$country[137] = "Mongolia";
$country[138] = "Montserrat";
$country[139] = "Morocco";
$country[140] = "Mozambique";
$country[141] = "Myanmar";
$country[142] = "Namibia";
$country[143] = "Nauru";
$country[144] = "Nepal";
$country[145] = "Netherlands";
$country[146] = "Netherlands Antilles";
$country[147] = "New zealand";
$country[148] = "Nicaragua";
$country[149] = "Niger";
$country[150] = "Nigeria";
$country[151] = "Niue";
$country[152] = "Norfolk Island";
$country[153] = "Norway";
$country[154] = "Oman";
$country[155] = "Pakistan";
$country[156] = "Palau";
$country[157] = "Panama";
$country[158] = "Paraguay";
$country[159] = "Peru";
$country[160] = "Philippines";
$country[161] = "Pitcairn";
$country[162] = "Poland";
$country[163] = "Portugal";
$country[164] = "Puerto Rico";
$country[165] = "Qatar";
$country[166] = "Reunion";
$country[167] = "Romania";
$country[168] = "Russian Federation";
$country[169] = "Rwanda";
$country[170] = "Saint Helena";
$country[171] = "Samoa";
$country[172] = "San Marino";
$country[173] = "Saudi Arabia";
$country[174] = "Senegal";
$country[175] = "Serbia and Montenegro";
$country[176] = "Sierra Leone";
$country[177] = "Singapore";
$country[178] = "Slovakia";
$country[179] = "Slovenia";
$country[180] = "South Africa";
$country[181] = "Spain";
$country[182] = "Sri Lanka";
$country[183] = "Sudan";
$country[184] = "Suriname";
$country[185] = "Swaziland";
$country[186] = "Sweden";
$country[187] = "Switzerland";
$country[188] = "Taiwan";
$country[189] = "Tajikistan";
$country[190] = "Tanzania";
$country[191] = "Thailand";
$country[192] = "Timor-Leste";
$country[193] = "Togo";
$country[194] = "Tonga";
$country[195] = "Trinidad And Tobago";
$country[196] = "Tunisia";
$country[197] = "Turkey";
$country[198] = "Turkmenistan";
$country[199] = "Tuvalu";
$country[200] = "Uganda";
$country[201] = "Ukraine";
$country[202] = "United Kingdom";
$country[203] = "United States";
$country[204] = "Uruguay";
$country[205] = "Uzbekistan";
$country[206] = "Venezuela";
$country[207] = "Viet Nam";
$country[208] = "Virgin Islands";
$country[209] = "Yemen";
$country[210] = "Zambia";
$country[211] = "Zimbabwe";
?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.