Subversion Repositories cheapmusic

Rev

Rev 65 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 - 1
<?php
2
function getCountry($code) {
65 - 3
    $countries = array(
4
        "AD" => "Andorra",
5
        "AE" => "United Arab Emirates",
6
        "AF" => "Afghanistan",
7
        "AG" => "Antigua and Barbuda",
8
        "AI" => "Anguilla",
9
        "AL" => "Albania",
10
        "AM" => "Armenia",
11
        "AO" => "Angola",
12
        "AQ" => "Antarctica",
13
        "AR" => "Argentina",
14
        "AS" => "American Samoa",
15
        "AT" => "Austria",
16
        "AU" => "Australia",
17
        "AW" => "Aruba",
18
        "AX" => "Åland Islands",
19
        "AZ" => "Azerbaijan",
20
        "BA" => "Bosnia and Herzegovina",
21
        "BB" => "Barbados",
22
        "BD" => "Bangladesh",
23
        "BE" => "Belgium",
24
        "BF" => "Burkina Faso",
25
        "BG" => "Bulgaria",
26
        "BH" => "Bahrain",
27
        "BI" => "Burundi",
28
        "BJ" => "Benin",
29
        "BL" => "Saint Barthélemy",
30
        "BM" => "Bermuda",
31
        "BN" => "Brunei Darussalam",
32
        "BO" => "Bolivia",
33
        "BQ" => "Bonaire, Sint Eustatius and Saba",
34
        "BR" => "Brazil",
35
        "BS" => "Bahamas",
36
        "BT" => "Bhutan",
37
        "BV" => "Bouvet Island",
38
        "BW" => "Botswana",
39
        "BY" => "Belarus",
40
        "BZ" => "Belize",
41
        "CA" => "Canada",
42
        "CC" => "Cocos (Keeling) Islands",
43
        "CD" => "Congo",
44
        "CF" => "Central African Republic",
45
        "CG" => "Congo",
46
        "CH" => "Switzerland",
47
        "CI" => "Côte d'Ivoire",
48
        "CK" => "Cook Islands",
49
        "CL" => "Chile",
50
        "CM" => "Cameroon",
51
        "CN" => "China",
52
        "CO" => "Colombia",
53
        "CR" => "Costa Rica",
54
        "CU" => "Cuba",
55
        "CV" => "Cabo Verde",
56
        "CW" => "Curaçao",
57
        "CX" => "Christmas Island",
58
        "CY" => "Cyprus",
59
        "CZ" => "Czechia",
60
        "DE" => "Germany",
61
        "DJ" => "Djibouti",
62
        "DK" => "Denmark",
63
        "DM" => "Dominica",
64
        "DO" => "Dominican Republic",
65
        "DZ" => "Algeria",
66
        "EC" => "Ecuador",
67
        "EE" => "Estonia",
68
        "EG" => "Egypt",
69
        "EH" => "Western Sahara*",
70
        "ER" => "Eritrea",
71
        "ES" => "Spain",
72
        "ET" => "Ethiopia",
73
        "FI" => "Finland",
74
        "FJ" => "Fiji",
75
        "FK" => "Falkland Islands [Malvinas]",
76
        "FM" => "Micronesia",
77
        "FO" => "Faroe Islands",
78
        "FR" => "France",
79
        "GA" => "Gabon",
80
        "GB" => "United Kingdom",
81
        "GD" => "Grenada",
82
        "GE" => "Georgia",
83
        "GF" => "French Guiana",
84
        "GG" => "Guernsey",
85
        "GH" => "Ghana",
86
        "GI" => "Gibraltar",
87
        "GL" => "Greenland",
88
        "GM" => "Gambia",
89
        "GN" => "Guinea",
90
        "GP" => "Guadeloupe",
91
        "GQ" => "Equatorial Guinea",
92
        "GR" => "Greece",
93
        "GS" => "South Georgia and South Sandwich Islands",
94
        "GT" => "Guatemala",
95
        "GU" => "Guam",
96
        "GW" => "Guinea-Bissau",
97
        "GY" => "Guyana",
98
        "HK" => "Hong Kong",
99
        "HM" => "Heard Island and McDonald Islands",
100
        "HN" => "Honduras",
101
        "HR" => "Croatia",
102
        "HT" => "Haiti",
103
        "HU" => "Hungary",
104
        "ID" => "Indonesia",
105
        "IE" => "Ireland",
106
        "IL" => "Israel",
107
        "IM" => "Isle of Man",
108
        "IN" => "India",
109
        "IO" => "British Indian Ocean Territory",
110
        "IQ" => "Iraq",
111
        "IR" => "Iran",
112
        "IS" => "Iceland",
113
        "IT" => "Italy",
114
        "JE" => "Jersey",
115
        "JM" => "Jamaica",
116
        "JO" => "Jordan",
117
        "JP" => "Japan",
118
        "KE" => "Kenya",
119
        "KG" => "Kyrgyzstan",
120
        "KH" => "Cambodia",
121
        "KI" => "Kiribati",
122
        "KM" => "Comoros",
123
        "KN" => "Saint Kitts and Nevis",
124
        "KP" => "North Korea",
125
        "KR" => "South Korea",
126
        "KW" => "Kuwait",
127
        "KY" => "Cayman Islands",
128
        "KZ" => "Kazakhstan",
129
        "LA" => "Lao People's Democratic Republic",
130
        "LB" => "Lebanon",
131
        "LC" => "Saint Lucia",
132
        "LI" => "Liechtenstein",
133
        "LK" => "Sri Lanka",
134
        "LR" => "Liberia",
135
        "LS" => "Lesotho",
136
        "LT" => "Lithuania",
137
        "LU" => "Luxembourg",
138
        "LV" => "Latvia",
139
        "LY" => "Libya",
140
        "MA" => "Morocco",
141
        "MC" => "Monaco",
142
        "MD" => "Moldova",
143
        "ME" => "Montenegro",
144
        "MF" => "Saint Martin (French)",
145
        "MG" => "Madagascar",
146
        "MH" => "Marshall Islands",
147
        "MK" => "North Macedonia",
148
        "ML" => "Mali",
149
        "MM" => "Myanmar",
150
        "MN" => "Mongolia",
151
        "MO" => "Macao",
152
        "MP" => "Northern Mariana Islands",
153
        "MQ" => "Martinique",
154
        "MR" => "Mauritania",
155
        "MS" => "Montserrat",
156
        "MT" => "Malta",
157
        "MU" => "Mauritius",
158
        "MV" => "Maldives",
159
        "MW" => "Malawi",
160
        "MX" => "Mexico",
161
        "MY" => "Malaysia",
162
        "MZ" => "Mozambique",
163
        "NA" => "Namibia",
164
        "NC" => "New Caledonia",
165
        "NE" => "Niger",
166
        "NF" => "Norfolk Island",
167
        "NG" => "Nigeria",
168
        "NI" => "Nicaragua",
169
        "NL" => "Netherlands",
170
        "NO" => "Norway",
171
        "NP" => "Nepal",
172
        "NR" => "Nauru",
173
        "NU" => "Niue",
174
        "NZ" => "New Zealand",
175
        "OM" => "Oman",
176
        "PA" => "Panama",
177
        "PE" => "Peru",
178
        "PF" => "French Polynesia",
179
        "PG" => "Papua New Guinea",
180
        "PH" => "Philippines",
181
        "PK" => "Pakistan",
182
        "PL" => "Poland",
183
        "PM" => "Saint Pierre and Miquelon",
184
        "PN" => "Pitcairn",
185
        "PR" => "Puerto Rico",
186
        "PS" => "Palestine",
187
        "PT" => "Portugal",
188
        "PW" => "Palau",
189
        "PY" => "Paraguay",
190
        "QA" => "Qatar",
191
        "RE" => "Réunion",
192
        "RO" => "Romania",
193
        "RS" => "Serbia",
194
        "RU" => "Russian Federation",
195
        "RW" => "Rwanda",
196
        "SA" => "Saudi Arabia",
197
        "SB" => "Solomon Islands",
198
        "SC" => "Seychelles",
199
        "SD" => "Sudan",
200
        "SE" => "Sweden",
201
        "SG" => "Singapore",
202
        "SH" => "Saint Helena, Ascension and Tristan da Cunha",
203
        "SI" => "Slovenia",
204
        "SJ" => "Svalbard and Jan Mayen",
205
        "SK" => "Slovakia",
206
        "SL" => "Sierra Leone",
207
        "SM" => "San Marino",
208
        "SN" => "Senegal",
209
        "SO" => "Somalia",
210
        "SR" => "Suriname",
211
        "SS" => "South Sudan",
212
        "ST" => "Sao Tome and Principe",
213
        "SV" => "El Salvador",
214
        "SX" => "Sint Maarten (Dutch)",
215
        "SY" => "Syrian Arab Republic",
216
        "SZ" => "Eswatini",
217
        "TC" => "Turks and Caicos Islands",
218
        "TD" => "Chad",
219
        "TF" => "French Southern Territories",
220
        "TG" => "Togo",
221
        "TH" => "Thailand",
222
        "TJ" => "Tajikistan",
223
        "TK" => "Tokelau",
224
        "TL" => "Timor-Leste",
225
        "TM" => "Turkmenistan",
226
        "TN" => "Tunisia",
227
        "TO" => "Tonga",
228
        "TR" => "Turkey",
229
        "TT" => "Trinidad and Tobago",
230
        "TV" => "Tuvalu",
231
        "TW" => "Taiwan",
232
        "TZ" => "Tanzania",
233
        "UA" => "Ukraine",
234
        "UG" => "Uganda",
235
        "UM" => "United States Minor Outlying Islands",
236
        "US" => "United States of America",
237
        "UY" => "Uruguay",
238
        "UZ" => "Uzbekistan",
239
        "VA" => "Holy See",
240
        "VC" => "Saint Vincent and the Grenadines",
241
        "VE" => "Venezuela",
242
        "VG" => "Virgin Islands (British)",
243
        "VI" => "Virgin Islands (U.S.)",
244
        "VN" => "Viet Nam",
245
        "VU" => "Vanuatu",
246
        "WF" => "Wallis and Futuna",
247
        "WS" => "Samoa",
248
        "YE" => "Yemen",
249
        "YT" => "Mayotte",
250
        "ZA" => "South Africa",
251
        "ZM" => "Zambia",
252
        "ZW" => "Zimbabwe"
253
    );
1 - 254
 
65 - 255
    if (array_key_exists($code, $countries)) {
256
        return ($countries[$code]);
257
    }
1 - 258
 
65 - 259
    return ("Unknown");
1 - 260
}
91 - 261
 
262
function getCountryCode($country) {
263
    $countries = array(
264
        "Afghanistan" => "AF",
265
        "Åland Islands" => "AX",
266
        "Albania" => "AL",
267
        "Algeria" => "DZ",
268
        "American Samoa" => "AS",
269
        "Andorra" => "AD",
270
        "Angola" => "AO",
271
        "Anguilla" => "AI",
272
        "Antarctica" => "AQ",
273
        "Antigua and Barbuda" => "AG",
274
        "Argentina" => "AR",
275
        "Armenia" => "AM",
276
        "Aruba" => "AW",
277
        "Australia" => "AU",
278
        "Austria" => "AT",
279
        "Azerbaijan" => "AZ",
280
        "Bahamas" => "BS",
281
        "Bahrain" => "BH",
282
        "Bangladesh" => "BD",
283
        "Barbados" => "BB",
284
        "Belarus" => "BY",
285
        "Belgium" => "BE",
286
        "Belize" => "BZ",
287
        "Benin" => "BJ",
288
        "Bermuda" => "BM",
289
        "Bhutan" => "BT",
290
        "Bolivia" => "BO",
291
        "Bonaire, Sint Eustatius and Saba" => "BQ",
292
        "Bosnia and Herzegovina" => "BA",
293
        "Botswana" => "BW",
294
        "Bouvet Island" => "BV",
295
        "Brazil" => "BR",
296
        "British Indian Ocean Territory" => "IO",
297
        "Brunei Darussalam" => "BN",
298
        "Bulgaria" => "BG",
299
        "Burkina Faso" => "BF",
300
        "Burundi" => "BI",
301
        "Cabo Verde" => "CV",
302
        "Cambodia" => "KH",
303
        "Cameroon" => "CM",
304
        "Canada" => "CA",
305
        "Cayman Islands" => "KY",
306
        "Central African Republic" => "CF",
307
        "Chad" => "TD",
308
        "Chile" => "CL",
309
        "China" => "CN",
310
        "Christmas Island" => "CX",
311
        "Cocos (Keeling) Islands" => "CC",
312
        "Colombia" => "CO",
313
        "Comoros" => "KM",
314
        "Congo" => "CD",
315
        "Congo" => "CG",
316
        "Cook Islands" => "CK",
317
        "Costa Rica" => "CR",
318
        "Côte d'Ivoire" => "CI",
319
        "Croatia" => "HR",
320
        "Cuba" => "CU",
321
        "Curaçao" => "CW",
322
        "Cyprus" => "CY",
323
        "Czechia" => "CZ",
324
        "Denmark" => "DK",
325
        "Djibouti" => "DJ",
326
        "Dominica" => "DM",
327
        "Dominican Republic" => "DO",
328
        "Ecuador" => "EC",
329
        "Egypt" => "EG",
330
        "El Salvador" => "SV",
331
        "Equatorial Guinea" => "GQ",
332
        "Eritrea" => "ER",
333
        "Estonia" => "EE",
334
        "Eswatini" => "SZ",
335
        "Ethiopia" => "ET",
336
        "Falkland Islands [Malvinas]" => "FK",
337
        "Faroe Islands" => "FO",
338
        "Fiji" => "FJ",
339
        "Finland" => "FI",
340
        "France" => "FR",
341
        "French Guiana" => "GF",
342
        "French Polynesia" => "PF",
343
        "French Southern Territories" => "TF",
344
        "Gabon" => "GA",
345
        "Gambia" => "GM",
346
        "Georgia" => "GE",
347
        "Germany" => "DE",
348
        "Ghana" => "GH",
349
        "Gibraltar" => "GI",
350
        "Greece" => "GR",
351
        "Greenland" => "GL",
352
        "Grenada" => "GD",
353
        "Guadeloupe" => "GP",
354
        "Guam" => "GU",
355
        "Guatemala" => "GT",
356
        "Guernsey" => "GG",
357
        "Guinea-Bissau" => "GW",
358
        "Guinea" => "GN",
359
        "Guyana" => "GY",
360
        "Haiti" => "HT",
361
        "Heard Island and McDonald Islands" => "HM",
362
        "Holy See" => "VA",
363
        "Honduras" => "HN",
364
        "Hong Kong" => "HK",
365
        "Hungary" => "HU",
366
        "Iceland" => "IS",
367
        "India" => "IN",
368
        "Indonesia" => "ID",
369
        "Iran" => "IR",
370
        "Iraq" => "IQ",
371
        "Ireland" => "IE",
372
        "Isle of Man" => "IM",
373
        "Israel" => "IL",
374
        "Italy" => "IT",
375
        "Jamaica" => "JM",
376
        "Japan" => "JP",
377
        "Jersey" => "JE",
378
        "Jordan" => "JO",
379
        "Kazakhstan" => "KZ",
380
        "Kenya" => "KE",
381
        "Kiribati" => "KI",
382
        "Kuwait" => "KW",
383
        "Kyrgyzstan" => "KG",
384
        "Lao People's Democratic Republic" => "LA",
385
        "Latvia" => "LV",
386
        "Lebanon" => "LB",
387
        "Lesotho" => "LS",
388
        "Liberia" => "LR",
389
        "Libya" => "LY",
390
        "Liechtenstein" => "LI",
391
        "Lithuania" => "LT",
392
        "Luxembourg" => "LU",
393
        "Macao" => "MO",
394
        "Madagascar" => "MG",
395
        "Malawi" => "MW",
396
        "Malaysia" => "MY",
397
        "Maldives" => "MV",
398
        "Mali" => "ML",
399
        "Malta" => "MT",
400
        "Marshall Islands" => "MH",
401
        "Martinique" => "MQ",
402
        "Mauritania" => "MR",
403
        "Mauritius" => "MU",
404
        "Mayotte" => "YT",
405
        "Mexico" => "MX",
406
        "Micronesia" => "FM",
407
        "Moldova" => "MD",
408
        "Monaco" => "MC",
409
        "Mongolia" => "MN",
410
        "Montenegro" => "ME",
411
        "Montserrat" => "MS",
412
        "Morocco" => "MA",
413
        "Mozambique" => "MZ",
414
        "Myanmar" => "MM",
415
        "Namibia" => "NA",
416
        "Nauru" => "NR",
417
        "Nepal" => "NP",
418
        "Netherlands" => "NL",
419
        "New Caledonia" => "NC",
420
        "New Zealand" => "NZ",
421
        "Nicaragua" => "NI",
422
        "Nigeria" => "NG",
423
        "Niger" => "NE",
424
        "Niue" => "NU",
425
        "Norfolk Island" => "NF",
426
        "Northern Mariana Islands" => "MP",
427
        "North Korea" => "KP",
428
        "North Macedonia" => "MK",
429
        "Norway" => "NO",
430
        "Oman" => "OM",
431
        "Pakistan" => "PK",
432
        "Palau" => "PW",
433
        "Palestine" => "PS",
434
        "Panama" => "PA",
435
        "Papua New Guinea" => "PG",
436
        "Paraguay" => "PY",
437
        "Peru" => "PE",
438
        "Philippines" => "PH",
439
        "Pitcairn" => "PN",
440
        "Poland" => "PL",
441
        "Portugal" => "PT",
442
        "Puerto Rico" => "PR",
443
        "Qatar" => "QA",
444
        "Réunion" => "RE",
445
        "Romania" => "RO",
446
        "Russian Federation" => "RU",
447
        "Rwanda" => "RW",
448
        "Saint Barthélemy" => "BL",
449
        "Saint Helena, Ascension and Tristan da Cunha" => "SH",
450
        "Saint Kitts and Nevis" => "KN",
451
        "Saint Lucia" => "LC",
452
        "Saint Martin (French)" => "MF",
453
        "Saint Pierre and Miquelon" => "PM",
454
        "Saint Vincent and the Grenadines" => "VC",
455
        "Samoa" => "WS",
456
        "San Marino" => "SM",
457
        "Sao Tome and Principe" => "ST",
458
        "Saudi Arabia" => "SA",
459
        "Senegal" => "SN",
460
        "Serbia" => "RS",
461
        "Seychelles" => "SC",
462
        "Sierra Leone" => "SL",
463
        "Singapore" => "SG",
464
        "Sint Maarten (Dutch)" => "SX",
465
        "Slovakia" => "SK",
466
        "Slovenia" => "SI",
467
        "Solomon Islands" => "SB",
468
        "Somalia" => "SO",
469
        "South Africa" => "ZA",
470
        "South Georgia and South Sandwich Islands" => "GS",
471
        "South Korea" => "KR",
472
        "South Sudan" => "SS",
473
        "Spain" => "ES",
474
        "Sri Lanka" => "LK",
475
        "Sudan" => "SD",
476
        "Suriname" => "SR",
477
        "Svalbard and Jan Mayen" => "SJ",
478
        "Sweden" => "SE",
479
        "Switzerland" => "CH",
480
        "Syrian Arab Republic" => "SY",
481
        "Taiwan" => "TW",
482
        "Tajikistan" => "TJ",
483
        "Tanzania" => "TZ",
484
        "Thailand" => "TH",
485
        "Timor-Leste" => "TL",
486
        "Togo" => "TG",
487
        "Tokelau" => "TK",
488
        "Tonga" => "TO",
489
        "Trinidad and Tobago" => "TT",
490
        "Tunisia" => "TN",
491
        "Turkey" => "TR",
492
        "Turkmenistan" => "TM",
493
        "Turks and Caicos Islands" => "TC",
494
        "Tuvalu" => "TV",
495
        "Uganda" => "UG",
496
        "Ukraine" => "UA",
497
        "United Arab Emirates" => "AE",
498
        "United Kingdom" => "GB",
499
        "United States Minor Outlying Islands" => "UM",
500
        "United States of America" => "US",
501
        "Uruguay" => "UY",
502
        "Uzbekistan" => "UZ",
503
        "Vanuatu" => "VU",
504
        "Venezuela" => "VE",
505
        "Viet Nam" => "VN",
506
        "Virgin Islands (British)" => "VG",
507
        "Virgin Islands (U.S.)" => "VI",
508
        "Wallis and Futuna" => "WF",
509
        "Western Sahara*" => "EH",
510
        "Yemen" => "YE",
511
        "Zambia" => "ZM",
512
        "Zimbabwe" => "ZW"
513
    );
514
 
515
    if (array_key_exists($country, $countries)) {
516
        return ($countries[$country]);
517
    }
518
 
519
    return ("US");
520
}
521
?>