├── .yamllint ├── LICENSE ├── composer.json └── src ├── Exception ├── DomainException.php ├── ISO3166Exception.php └── OutOfBoundsException.php ├── Guards.php ├── ISO3166.php ├── ISO3166DataProvider.php ├── ISO3166DataValidator.php └── ISO3166WithAliases.php /.yamllint: -------------------------------------------------------------------------------- 1 | extends: default 2 | rules: 3 | braces: 4 | min-spaces-inside: 1 5 | max-spaces-inside: 1 6 | min-spaces-inside-empty: 0 7 | max-spaces-inside-empty: 0 8 | brackets: 9 | min-spaces-inside: 0 10 | max-spaces-inside: 0 11 | min-spaces-inside-empty: 0 12 | max-spaces-inside-empty: 0 13 | comments: 14 | min-spaces-from-content: 1 15 | document-start: disable 16 | line-length: 17 | level: warning 18 | max: 140 19 | allow-non-breakable-inline-mappings: true 20 | allow-non-breakable-words: true 21 | truthy: 22 | check-keys: false 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) Rob Bast 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "league/iso3166", 3 | "description": "ISO 3166-1 PHP Library", 4 | "keywords": ["ISO 3166", "ISO", "3166", "3166-1", "countries", "library"], 5 | "homepage": "https://github.com/alcohol/iso3166", 6 | "license": "MIT", 7 | "authors": [{ 8 | "name": "Rob Bast", 9 | "email": "rob.bast@gmail.com" 10 | }], 11 | "support": { 12 | "issues": "https://github.com/alcohol/iso3166/issues", 13 | "source": "https://github.com/alcohol/iso3166" 14 | }, 15 | "require": { 16 | "php": "^7.4 || ^8.0", 17 | "ext-mbstring": "*" 18 | }, 19 | "autoload": { 20 | "psr-4": { "League\\ISO3166\\": "src" } 21 | }, 22 | "require-dev": { 23 | "phpunit/phpunit": "^9.6.21", 24 | "phpstan/phpstan": "^1.12.6", 25 | "phpstan/phpstan-deprecation-rules": "^1.2.1", 26 | "phpstan/phpstan-strict-rules": "^1.6.1" 27 | }, 28 | "autoload-dev": { 29 | "psr-4": { "League\\ISO3166\\": "tests" } 30 | }, 31 | "scripts": { 32 | "test": "vendor/bin/phpunit", 33 | "phpstan": "vendor/bin/phpstan", 34 | "php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff", 35 | "php-cs-fixer-fix": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix" 36 | }, 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "4.x-dev" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Exception/DomainException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166\Exception; 13 | 14 | final class DomainException extends \DomainException implements ISO3166Exception 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /src/Exception/ISO3166Exception.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166\Exception; 13 | 14 | interface ISO3166Exception extends \Throwable 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /src/Exception/OutOfBoundsException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166\Exception; 13 | 14 | final class OutOfBoundsException extends \OutOfBoundsException implements ISO3166Exception 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /src/Guards.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166; 13 | 14 | use League\ISO3166\Exception\DomainException; 15 | 16 | final class Guards 17 | { 18 | /** 19 | * Assert that input is not an empty string. 20 | * 21 | * @throws DomainException if input is an empty string 22 | */ 23 | public static function guardAgainstInvalidName(string $name): void 24 | { 25 | if ('' === trim($name)) { 26 | throw new DomainException('Expected string, got empty string'); 27 | } 28 | } 29 | 30 | /** 31 | * Assert that input looks like an alpha2 key. 32 | * 33 | * @throws DomainException if input does not look like an alpha2 key 34 | */ 35 | public static function guardAgainstInvalidAlpha2(string $alpha2): void 36 | { 37 | if (1 !== preg_match('/^[a-zA-Z]{2}$/', $alpha2)) { 38 | throw new DomainException(sprintf('Not a valid alpha2 key: %s', $alpha2)); 39 | } 40 | } 41 | 42 | /** 43 | * Assert that input looks like an alpha3 key. 44 | * 45 | * @throws DomainException if input does not look like an alpha3 key 46 | */ 47 | public static function guardAgainstInvalidAlpha3(string $alpha3): void 48 | { 49 | if (1 !== preg_match('/^[a-zA-Z]{3}$/', $alpha3)) { 50 | throw new DomainException(sprintf('Not a valid alpha3 key: %s', $alpha3)); 51 | } 52 | } 53 | 54 | /** 55 | * Assert that input looks like a numeric key. 56 | * 57 | * @throws DomainException if input does not look like a numeric key 58 | */ 59 | public static function guardAgainstInvalidNumeric(string $numeric): void 60 | { 61 | if (1 !== preg_match('/^\d{3}$/', $numeric)) { 62 | throw new DomainException(sprintf('Not a valid numeric key: %s', $numeric)); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/ISO3166.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166; 13 | 14 | use League\ISO3166\Exception\DomainException; 15 | use League\ISO3166\Exception\OutOfBoundsException; 16 | 17 | /** @implements \IteratorAggregate */ 18 | final class ISO3166 implements \Countable, \IteratorAggregate, ISO3166DataProvider 19 | { 20 | /** @var string */ 21 | public const KEY_ALPHA2 = 'alpha2'; 22 | /** @var string */ 23 | public const KEY_ALPHA3 = 'alpha3'; 24 | /** @var string */ 25 | public const KEY_NUMERIC = 'numeric'; 26 | /** @var string */ 27 | public const KEY_NAME = 'name'; 28 | /** @var string[] */ 29 | private array $keys = [self::KEY_ALPHA2, self::KEY_ALPHA3, self::KEY_NUMERIC, self::KEY_NAME]; 30 | 31 | /** 32 | * @param array $countries replace default dataset with given array 33 | */ 34 | public function __construct(array $countries = []) 35 | { 36 | if ([] !== $countries) { 37 | $this->countries = $countries; 38 | } 39 | } 40 | 41 | /** 42 | * @return array{name: string, alpha2: string, alpha3: string, numeric: numeric-string, currency: string[]} 43 | */ 44 | public function name(string $name): array 45 | { 46 | Guards::guardAgainstInvalidName($name); 47 | 48 | return $this->lookup(self::KEY_NAME, $name); 49 | } 50 | 51 | /** 52 | * @return array{name: string, alpha2: string, alpha3: string, numeric: numeric-string, currency: string[]} 53 | */ 54 | public function alpha2(string $alpha2): array 55 | { 56 | Guards::guardAgainstInvalidAlpha2($alpha2); 57 | 58 | return $this->lookup(self::KEY_ALPHA2, $alpha2); 59 | } 60 | 61 | /** 62 | * @return array{name: string, alpha2: string, alpha3: string, numeric: numeric-string, currency: string[]} 63 | */ 64 | public function alpha3(string $alpha3): array 65 | { 66 | Guards::guardAgainstInvalidAlpha3($alpha3); 67 | 68 | return $this->lookup(self::KEY_ALPHA3, $alpha3); 69 | } 70 | 71 | /** 72 | * @return array{name: string, alpha2: string, alpha3: string, numeric: numeric-string, currency: string[]} 73 | */ 74 | public function numeric(string $numeric): array 75 | { 76 | Guards::guardAgainstInvalidNumeric($numeric); 77 | 78 | return $this->lookup(self::KEY_NUMERIC, $numeric); 79 | } 80 | 81 | /** 82 | * @return array{name: string, alpha2: string, alpha3: string, numeric: numeric-string, currency: string[]} 83 | */ 84 | public function exactName(string $name): array 85 | { 86 | Guards::guardAgainstInvalidName($name); 87 | 88 | $value = mb_strtolower($name); 89 | 90 | foreach ($this->countries as $country) { 91 | $comparison = mb_strtolower($country[self::KEY_NAME]); 92 | 93 | if ($value === $comparison) { 94 | return $country; 95 | } 96 | } 97 | 98 | throw new OutOfBoundsException(sprintf('No "%s" key found matching: %s', self::KEY_NAME, $value)); 99 | } 100 | 101 | /** 102 | * @return array 103 | */ 104 | public function all(): array 105 | { 106 | return $this->countries; 107 | } 108 | 109 | /** 110 | * @param 'name'|'alpha2'|'alpha3'|'numeric' $key 111 | * 112 | * @throws DomainException if an invalid key is specified 113 | * 114 | * @return \Generator 115 | */ 116 | public function iterator(string $key = self::KEY_ALPHA2): \Generator 117 | { 118 | if (!in_array($key, $this->keys, true)) { 119 | throw new DomainException(sprintf('Invalid value for $key, got "%s", expected one of: %s', $key, implode(', ', $this->keys))); 120 | } 121 | 122 | foreach ($this->countries as $country) { 123 | yield $country[$key] => $country; 124 | } 125 | } 126 | 127 | /** 128 | * @see \Countable 129 | * 130 | * @internal 131 | */ 132 | public function count(): int 133 | { 134 | return count($this->countries); 135 | } 136 | 137 | /** 138 | * @return \Generator>> 139 | * 140 | * @see \IteratorAggregate 141 | * 142 | * @internal 143 | */ 144 | public function getIterator(): \Generator 145 | { 146 | foreach ($this->countries as $country) { 147 | yield $country; 148 | } 149 | } 150 | 151 | /** 152 | * Lookup ISO3166-1 data by given identifier. 153 | * 154 | * Looks for a match against the given key for each entry in the dataset. 155 | * 156 | * @param 'name'|'alpha2'|'alpha3'|'numeric' $key 157 | * 158 | * @throws OutOfBoundsException if key does not exist in dataset 159 | * 160 | * @return array{name: string, alpha2: string, alpha3: string, numeric: numeric-string, currency: string[]} 161 | */ 162 | private function lookup(string $key, string $value): array 163 | { 164 | $value = mb_strtolower($value); 165 | 166 | foreach ($this->countries as $country) { 167 | $comparison = mb_strtolower($country[$key]); 168 | 169 | if ($value === $comparison || $value === mb_substr($comparison, 0, mb_strlen($value))) { 170 | return $country; 171 | } 172 | } 173 | 174 | throw new OutOfBoundsException(sprintf('No "%s" key found matching: %s', $key, $value)); 175 | } 176 | 177 | /** 178 | * Default dataset. 179 | * 180 | * @var array> 181 | */ 182 | private array $countries = [ 183 | [ 184 | 'name' => 'Afghanistan', 185 | 'alpha2' => 'AF', 186 | 'alpha3' => 'AFG', 187 | 'numeric' => '004', 188 | 'currency' => [ 189 | 'AFN', 190 | ], 191 | ], 192 | [ 193 | 'name' => 'Åland Islands', 194 | 'alpha2' => 'AX', 195 | 'alpha3' => 'ALA', 196 | 'numeric' => '248', 197 | 'currency' => [ 198 | 'EUR', 199 | ], 200 | ], 201 | [ 202 | 'name' => 'Albania', 203 | 'alpha2' => 'AL', 204 | 'alpha3' => 'ALB', 205 | 'numeric' => '008', 206 | 'currency' => [ 207 | 'ALL', 208 | ], 209 | ], 210 | [ 211 | 'name' => 'Algeria', 212 | 'alpha2' => 'DZ', 213 | 'alpha3' => 'DZA', 214 | 'numeric' => '012', 215 | 'currency' => [ 216 | 'DZD', 217 | ], 218 | ], 219 | [ 220 | 'name' => 'American Samoa', 221 | 'alpha2' => 'AS', 222 | 'alpha3' => 'ASM', 223 | 'numeric' => '016', 224 | 'currency' => [ 225 | 'USD', 226 | ], 227 | ], 228 | [ 229 | 'name' => 'Andorra', 230 | 'alpha2' => 'AD', 231 | 'alpha3' => 'AND', 232 | 'numeric' => '020', 233 | 'currency' => [ 234 | 'EUR', 235 | ], 236 | ], 237 | [ 238 | 'name' => 'Angola', 239 | 'alpha2' => 'AO', 240 | 'alpha3' => 'AGO', 241 | 'numeric' => '024', 242 | 'currency' => [ 243 | 'AOA', 244 | ], 245 | ], 246 | [ 247 | 'name' => 'Anguilla', 248 | 'alpha2' => 'AI', 249 | 'alpha3' => 'AIA', 250 | 'numeric' => '660', 251 | 'currency' => [ 252 | 'XCD', 253 | ], 254 | ], 255 | [ 256 | 'name' => 'Antarctica', 257 | 'alpha2' => 'AQ', 258 | 'alpha3' => 'ATA', 259 | 'numeric' => '010', 260 | 'currency' => [ 261 | 'ARS', 262 | 'AUD', 263 | 'BGN', 264 | 'BRL', 265 | 'BYR', 266 | 'CLP', 267 | 'CNY', 268 | 'CZK', 269 | 'EUR', 270 | 'GBP', 271 | 'INR', 272 | 'JPY', 273 | 'KRW', 274 | 'NOK', 275 | 'NZD', 276 | 'PEN', 277 | 'PKR', 278 | 'PLN', 279 | 'RON', 280 | 'RUB', 281 | 'SEK', 282 | 'UAH', 283 | 'USD', 284 | 'UYU', 285 | 'ZAR', 286 | ], 287 | ], 288 | [ 289 | 'name' => 'Antigua and Barbuda', 290 | 'alpha2' => 'AG', 291 | 'alpha3' => 'ATG', 292 | 'numeric' => '028', 293 | 'currency' => [ 294 | 'XCD', 295 | ], 296 | ], 297 | [ 298 | 'name' => 'Argentina', 299 | 'alpha2' => 'AR', 300 | 'alpha3' => 'ARG', 301 | 'numeric' => '032', 302 | 'currency' => [ 303 | 'ARS', 304 | ], 305 | ], 306 | [ 307 | 'name' => 'Armenia', 308 | 'alpha2' => 'AM', 309 | 'alpha3' => 'ARM', 310 | 'numeric' => '051', 311 | 'currency' => [ 312 | 'AMD', 313 | ], 314 | ], 315 | [ 316 | 'name' => 'Aruba', 317 | 'alpha2' => 'AW', 318 | 'alpha3' => 'ABW', 319 | 'numeric' => '533', 320 | 'currency' => [ 321 | 'AWG', 322 | ], 323 | ], 324 | [ 325 | 'name' => 'Australia', 326 | 'alpha2' => 'AU', 327 | 'alpha3' => 'AUS', 328 | 'numeric' => '036', 329 | 'currency' => [ 330 | 'AUD', 331 | ], 332 | ], 333 | [ 334 | 'name' => 'Austria', 335 | 'alpha2' => 'AT', 336 | 'alpha3' => 'AUT', 337 | 'numeric' => '040', 338 | 'currency' => [ 339 | 'EUR', 340 | ], 341 | ], 342 | [ 343 | 'name' => 'Azerbaijan', 344 | 'alpha2' => 'AZ', 345 | 'alpha3' => 'AZE', 346 | 'numeric' => '031', 347 | 'currency' => [ 348 | 'AZN', 349 | ], 350 | ], 351 | [ 352 | 'name' => 'Bahamas', 353 | 'alpha2' => 'BS', 354 | 'alpha3' => 'BHS', 355 | 'numeric' => '044', 356 | 'currency' => [ 357 | 'BSD', 358 | ], 359 | ], 360 | [ 361 | 'name' => 'Bahrain', 362 | 'alpha2' => 'BH', 363 | 'alpha3' => 'BHR', 364 | 'numeric' => '048', 365 | 'currency' => [ 366 | 'BHD', 367 | ], 368 | ], 369 | [ 370 | 'name' => 'Bangladesh', 371 | 'alpha2' => 'BD', 372 | 'alpha3' => 'BGD', 373 | 'numeric' => '050', 374 | 'currency' => [ 375 | 'BDT', 376 | ], 377 | ], 378 | [ 379 | 'name' => 'Barbados', 380 | 'alpha2' => 'BB', 381 | 'alpha3' => 'BRB', 382 | 'numeric' => '052', 383 | 'currency' => [ 384 | 'BBD', 385 | ], 386 | ], 387 | [ 388 | 'name' => 'Belarus', 389 | 'alpha2' => 'BY', 390 | 'alpha3' => 'BLR', 391 | 'numeric' => '112', 392 | 'currency' => [ 393 | 'BYN', 394 | ], 395 | ], 396 | [ 397 | 'name' => 'Belgium', 398 | 'alpha2' => 'BE', 399 | 'alpha3' => 'BEL', 400 | 'numeric' => '056', 401 | 'currency' => [ 402 | 'EUR', 403 | ], 404 | ], 405 | [ 406 | 'name' => 'Belize', 407 | 'alpha2' => 'BZ', 408 | 'alpha3' => 'BLZ', 409 | 'numeric' => '084', 410 | 'currency' => [ 411 | 'BZD', 412 | ], 413 | ], 414 | [ 415 | 'name' => 'Benin', 416 | 'alpha2' => 'BJ', 417 | 'alpha3' => 'BEN', 418 | 'numeric' => '204', 419 | 'currency' => [ 420 | 'XOF', 421 | ], 422 | ], 423 | [ 424 | 'name' => 'Bermuda', 425 | 'alpha2' => 'BM', 426 | 'alpha3' => 'BMU', 427 | 'numeric' => '060', 428 | 'currency' => [ 429 | 'BMD', 430 | ], 431 | ], 432 | [ 433 | 'name' => 'Bhutan', 434 | 'alpha2' => 'BT', 435 | 'alpha3' => 'BTN', 436 | 'numeric' => '064', 437 | 'currency' => [ 438 | 'BTN', 439 | ], 440 | ], 441 | [ 442 | 'name' => 'Bolivia (Plurinational State of)', 443 | 'alpha2' => 'BO', 444 | 'alpha3' => 'BOL', 445 | 'numeric' => '068', 446 | 'currency' => [ 447 | 'BOB', 448 | ], 449 | ], 450 | [ 451 | 'name' => 'Bonaire, Sint Eustatius and Saba', 452 | 'alpha2' => 'BQ', 453 | 'alpha3' => 'BES', 454 | 'numeric' => '535', 455 | 'currency' => [ 456 | 'USD', 457 | ], 458 | ], 459 | [ 460 | 'name' => 'Bosnia and Herzegovina', 461 | 'alpha2' => 'BA', 462 | 'alpha3' => 'BIH', 463 | 'numeric' => '070', 464 | 'currency' => [ 465 | 'BAM', 466 | ], 467 | ], 468 | [ 469 | 'name' => 'Botswana', 470 | 'alpha2' => 'BW', 471 | 'alpha3' => 'BWA', 472 | 'numeric' => '072', 473 | 'currency' => [ 474 | 'BWP', 475 | ], 476 | ], 477 | [ 478 | 'name' => 'Bouvet Island', 479 | 'alpha2' => 'BV', 480 | 'alpha3' => 'BVT', 481 | 'numeric' => '074', 482 | 'currency' => [ 483 | 'NOK', 484 | ], 485 | ], 486 | [ 487 | 'name' => 'Brazil', 488 | 'alpha2' => 'BR', 489 | 'alpha3' => 'BRA', 490 | 'numeric' => '076', 491 | 'currency' => [ 492 | 'BRL', 493 | ], 494 | ], 495 | [ 496 | 'name' => 'British Indian Ocean Territory', 497 | 'alpha2' => 'IO', 498 | 'alpha3' => 'IOT', 499 | 'numeric' => '086', 500 | 'currency' => [ 501 | 'GBP', 502 | ], 503 | ], 504 | [ 505 | 'name' => 'Brunei Darussalam', 506 | 'alpha2' => 'BN', 507 | 'alpha3' => 'BRN', 508 | 'numeric' => '096', 509 | 'currency' => [ 510 | 'BND', 511 | 'SGD', 512 | ], 513 | ], 514 | [ 515 | 'name' => 'Bulgaria', 516 | 'alpha2' => 'BG', 517 | 'alpha3' => 'BGR', 518 | 'numeric' => '100', 519 | 'currency' => [ 520 | 'BGN', 521 | ], 522 | ], 523 | [ 524 | 'name' => 'Burkina Faso', 525 | 'alpha2' => 'BF', 526 | 'alpha3' => 'BFA', 527 | 'numeric' => '854', 528 | 'currency' => [ 529 | 'XOF', 530 | ], 531 | ], 532 | [ 533 | 'name' => 'Burundi', 534 | 'alpha2' => 'BI', 535 | 'alpha3' => 'BDI', 536 | 'numeric' => '108', 537 | 'currency' => [ 538 | 'BIF', 539 | ], 540 | ], 541 | [ 542 | 'name' => 'Cabo Verde', 543 | 'alpha2' => 'CV', 544 | 'alpha3' => 'CPV', 545 | 'numeric' => '132', 546 | 'currency' => [ 547 | 'CVE', 548 | ], 549 | ], 550 | [ 551 | 'name' => 'Cambodia', 552 | 'alpha2' => 'KH', 553 | 'alpha3' => 'KHM', 554 | 'numeric' => '116', 555 | 'currency' => [ 556 | 'KHR', 557 | ], 558 | ], 559 | [ 560 | 'name' => 'Cameroon', 561 | 'alpha2' => 'CM', 562 | 'alpha3' => 'CMR', 563 | 'numeric' => '120', 564 | 'currency' => [ 565 | 'XAF', 566 | ], 567 | ], 568 | [ 569 | 'name' => 'Canada', 570 | 'alpha2' => 'CA', 571 | 'alpha3' => 'CAN', 572 | 'numeric' => '124', 573 | 'currency' => [ 574 | 'CAD', 575 | ], 576 | ], 577 | [ 578 | 'name' => 'Cayman Islands', 579 | 'alpha2' => 'KY', 580 | 'alpha3' => 'CYM', 581 | 'numeric' => '136', 582 | 'currency' => [ 583 | 'KYD', 584 | ], 585 | ], 586 | [ 587 | 'name' => 'Central African Republic', 588 | 'alpha2' => 'CF', 589 | 'alpha3' => 'CAF', 590 | 'numeric' => '140', 591 | 'currency' => [ 592 | 'XAF', 593 | ], 594 | ], 595 | [ 596 | 'name' => 'Chad', 597 | 'alpha2' => 'TD', 598 | 'alpha3' => 'TCD', 599 | 'numeric' => '148', 600 | 'currency' => [ 601 | 'XAF', 602 | ], 603 | ], 604 | [ 605 | 'name' => 'Chile', 606 | 'alpha2' => 'CL', 607 | 'alpha3' => 'CHL', 608 | 'numeric' => '152', 609 | 'currency' => [ 610 | 'CLP', 611 | ], 612 | ], 613 | [ 614 | 'name' => 'China', 615 | 'alpha2' => 'CN', 616 | 'alpha3' => 'CHN', 617 | 'numeric' => '156', 618 | 'currency' => [ 619 | 'CNY', 620 | ], 621 | ], 622 | [ 623 | 'name' => 'Christmas Island', 624 | 'alpha2' => 'CX', 625 | 'alpha3' => 'CXR', 626 | 'numeric' => '162', 627 | 'currency' => [ 628 | 'AUD', 629 | ], 630 | ], 631 | [ 632 | 'name' => 'Cocos (Keeling) Islands', 633 | 'alpha2' => 'CC', 634 | 'alpha3' => 'CCK', 635 | 'numeric' => '166', 636 | 'currency' => [ 637 | 'AUD', 638 | ], 639 | ], 640 | [ 641 | 'name' => 'Colombia', 642 | 'alpha2' => 'CO', 643 | 'alpha3' => 'COL', 644 | 'numeric' => '170', 645 | 'currency' => [ 646 | 'COP', 647 | ], 648 | ], 649 | [ 650 | 'name' => 'Comoros', 651 | 'alpha2' => 'KM', 652 | 'alpha3' => 'COM', 653 | 'numeric' => '174', 654 | 'currency' => [ 655 | 'KMF', 656 | ], 657 | ], 658 | [ 659 | 'name' => 'Congo', 660 | 'alpha2' => 'CG', 661 | 'alpha3' => 'COG', 662 | 'numeric' => '178', 663 | 'currency' => [ 664 | 'XAF', 665 | ], 666 | ], 667 | [ 668 | 'name' => 'Congo (Democratic Republic of the)', 669 | 'alpha2' => 'CD', 670 | 'alpha3' => 'COD', 671 | 'numeric' => '180', 672 | 'currency' => [ 673 | 'CDF', 674 | ], 675 | ], 676 | [ 677 | 'name' => 'Cook Islands', 678 | 'alpha2' => 'CK', 679 | 'alpha3' => 'COK', 680 | 'numeric' => '184', 681 | 'currency' => [ 682 | 'NZD', 683 | ], 684 | ], 685 | [ 686 | 'name' => 'Costa Rica', 687 | 'alpha2' => 'CR', 688 | 'alpha3' => 'CRI', 689 | 'numeric' => '188', 690 | 'currency' => [ 691 | 'CRC', 692 | ], 693 | ], 694 | [ 695 | 'name' => 'Côte d\'Ivoire', 696 | 'alpha2' => 'CI', 697 | 'alpha3' => 'CIV', 698 | 'numeric' => '384', 699 | 'currency' => [ 700 | 'XOF', 701 | ], 702 | ], 703 | [ 704 | 'name' => 'Croatia', 705 | 'alpha2' => 'HR', 706 | 'alpha3' => 'HRV', 707 | 'numeric' => '191', 708 | 'currency' => [ 709 | 'EUR', 710 | ], 711 | ], 712 | [ 713 | 'name' => 'Cuba', 714 | 'alpha2' => 'CU', 715 | 'alpha3' => 'CUB', 716 | 'numeric' => '192', 717 | 'currency' => [ 718 | 'CUC', 719 | 'CUP', 720 | ], 721 | ], 722 | [ 723 | 'name' => 'Curaçao', 724 | 'alpha2' => 'CW', 725 | 'alpha3' => 'CUW', 726 | 'numeric' => '531', 727 | 'currency' => [ 728 | 'ANG', 729 | ], 730 | ], 731 | [ 732 | 'name' => 'Cyprus', 733 | 'alpha2' => 'CY', 734 | 'alpha3' => 'CYP', 735 | 'numeric' => '196', 736 | 'currency' => [ 737 | 'EUR', 738 | ], 739 | ], 740 | [ 741 | 'name' => 'Czechia', 742 | 'alpha2' => 'CZ', 743 | 'alpha3' => 'CZE', 744 | 'numeric' => '203', 745 | 'currency' => [ 746 | 'CZK', 747 | ], 748 | ], 749 | [ 750 | 'name' => 'Denmark', 751 | 'alpha2' => 'DK', 752 | 'alpha3' => 'DNK', 753 | 'numeric' => '208', 754 | 'currency' => [ 755 | 'DKK', 756 | ], 757 | ], 758 | [ 759 | 'name' => 'Djibouti', 760 | 'alpha2' => 'DJ', 761 | 'alpha3' => 'DJI', 762 | 'numeric' => '262', 763 | 'currency' => [ 764 | 'DJF', 765 | ], 766 | ], 767 | [ 768 | 'name' => 'Dominica', 769 | 'alpha2' => 'DM', 770 | 'alpha3' => 'DMA', 771 | 'numeric' => '212', 772 | 'currency' => [ 773 | 'XCD', 774 | ], 775 | ], 776 | [ 777 | 'name' => 'Dominican Republic', 778 | 'alpha2' => 'DO', 779 | 'alpha3' => 'DOM', 780 | 'numeric' => '214', 781 | 'currency' => [ 782 | 'DOP', 783 | ], 784 | ], 785 | [ 786 | 'name' => 'Ecuador', 787 | 'alpha2' => 'EC', 788 | 'alpha3' => 'ECU', 789 | 'numeric' => '218', 790 | 'currency' => [ 791 | 'USD', 792 | ], 793 | ], 794 | [ 795 | 'name' => 'Egypt', 796 | 'alpha2' => 'EG', 797 | 'alpha3' => 'EGY', 798 | 'numeric' => '818', 799 | 'currency' => [ 800 | 'EGP', 801 | ], 802 | ], 803 | [ 804 | 'name' => 'El Salvador', 805 | 'alpha2' => 'SV', 806 | 'alpha3' => 'SLV', 807 | 'numeric' => '222', 808 | 'currency' => [ 809 | 'USD', 810 | ], 811 | ], 812 | [ 813 | 'name' => 'Equatorial Guinea', 814 | 'alpha2' => 'GQ', 815 | 'alpha3' => 'GNQ', 816 | 'numeric' => '226', 817 | 'currency' => [ 818 | 'XAF', 819 | ], 820 | ], 821 | [ 822 | 'name' => 'Eritrea', 823 | 'alpha2' => 'ER', 824 | 'alpha3' => 'ERI', 825 | 'numeric' => '232', 826 | 'currency' => [ 827 | 'ERN', 828 | ], 829 | ], 830 | [ 831 | 'name' => 'Estonia', 832 | 'alpha2' => 'EE', 833 | 'alpha3' => 'EST', 834 | 'numeric' => '233', 835 | 'currency' => [ 836 | 'EUR', 837 | ], 838 | ], 839 | [ 840 | 'name' => 'Ethiopia', 841 | 'alpha2' => 'ET', 842 | 'alpha3' => 'ETH', 843 | 'numeric' => '231', 844 | 'currency' => [ 845 | 'ETB', 846 | ], 847 | ], 848 | [ 849 | 'name' => 'Eswatini', 850 | 'alpha2' => 'SZ', 851 | 'alpha3' => 'SWZ', 852 | 'numeric' => '748', 853 | 'currency' => [ 854 | 'SZL', 855 | 'ZAR', 856 | ], 857 | ], 858 | [ 859 | 'name' => 'Falkland Islands (Malvinas)', 860 | 'alpha2' => 'FK', 861 | 'alpha3' => 'FLK', 862 | 'numeric' => '238', 863 | 'currency' => [ 864 | 'FKP', 865 | ], 866 | ], 867 | [ 868 | 'name' => 'Faroe Islands', 869 | 'alpha2' => 'FO', 870 | 'alpha3' => 'FRO', 871 | 'numeric' => '234', 872 | 'currency' => [ 873 | 'DKK', 874 | ], 875 | ], 876 | [ 877 | 'name' => 'Fiji', 878 | 'alpha2' => 'FJ', 879 | 'alpha3' => 'FJI', 880 | 'numeric' => '242', 881 | 'currency' => [ 882 | 'FJD', 883 | ], 884 | ], 885 | [ 886 | 'name' => 'Finland', 887 | 'alpha2' => 'FI', 888 | 'alpha3' => 'FIN', 889 | 'numeric' => '246', 890 | 'currency' => [ 891 | 'EUR', 892 | ], 893 | ], 894 | [ 895 | 'name' => 'France', 896 | 'alpha2' => 'FR', 897 | 'alpha3' => 'FRA', 898 | 'numeric' => '250', 899 | 'currency' => [ 900 | 'EUR', 901 | ], 902 | ], 903 | [ 904 | 'name' => 'French Guiana', 905 | 'alpha2' => 'GF', 906 | 'alpha3' => 'GUF', 907 | 'numeric' => '254', 908 | 'currency' => [ 909 | 'EUR', 910 | ], 911 | ], 912 | [ 913 | 'name' => 'French Polynesia', 914 | 'alpha2' => 'PF', 915 | 'alpha3' => 'PYF', 916 | 'numeric' => '258', 917 | 'currency' => [ 918 | 'XPF', 919 | ], 920 | ], 921 | [ 922 | 'name' => 'French Southern Territories', 923 | 'alpha2' => 'TF', 924 | 'alpha3' => 'ATF', 925 | 'numeric' => '260', 926 | 'currency' => [ 927 | 'EUR', 928 | ], 929 | ], 930 | [ 931 | 'name' => 'Gabon', 932 | 'alpha2' => 'GA', 933 | 'alpha3' => 'GAB', 934 | 'numeric' => '266', 935 | 'currency' => [ 936 | 'XAF', 937 | ], 938 | ], 939 | [ 940 | 'name' => 'Gambia', 941 | 'alpha2' => 'GM', 942 | 'alpha3' => 'GMB', 943 | 'numeric' => '270', 944 | 'currency' => [ 945 | 'GMD', 946 | ], 947 | ], 948 | [ 949 | 'name' => 'Georgia', 950 | 'alpha2' => 'GE', 951 | 'alpha3' => 'GEO', 952 | 'numeric' => '268', 953 | 'currency' => [ 954 | 'GEL', 955 | ], 956 | ], 957 | [ 958 | 'name' => 'Germany', 959 | 'alpha2' => 'DE', 960 | 'alpha3' => 'DEU', 961 | 'numeric' => '276', 962 | 'currency' => [ 963 | 'EUR', 964 | ], 965 | ], 966 | [ 967 | 'name' => 'Ghana', 968 | 'alpha2' => 'GH', 969 | 'alpha3' => 'GHA', 970 | 'numeric' => '288', 971 | 'currency' => [ 972 | 'GHS', 973 | ], 974 | ], 975 | [ 976 | 'name' => 'Gibraltar', 977 | 'alpha2' => 'GI', 978 | 'alpha3' => 'GIB', 979 | 'numeric' => '292', 980 | 'currency' => [ 981 | 'GIP', 982 | ], 983 | ], 984 | [ 985 | 'name' => 'Greece', 986 | 'alpha2' => 'GR', 987 | 'alpha3' => 'GRC', 988 | 'numeric' => '300', 989 | 'currency' => [ 990 | 'EUR', 991 | ], 992 | ], 993 | [ 994 | 'name' => 'Greenland', 995 | 'alpha2' => 'GL', 996 | 'alpha3' => 'GRL', 997 | 'numeric' => '304', 998 | 'currency' => [ 999 | 'DKK', 1000 | ], 1001 | ], 1002 | [ 1003 | 'name' => 'Grenada', 1004 | 'alpha2' => 'GD', 1005 | 'alpha3' => 'GRD', 1006 | 'numeric' => '308', 1007 | 'currency' => [ 1008 | 'XCD', 1009 | ], 1010 | ], 1011 | [ 1012 | 'name' => 'Guadeloupe', 1013 | 'alpha2' => 'GP', 1014 | 'alpha3' => 'GLP', 1015 | 'numeric' => '312', 1016 | 'currency' => [ 1017 | 'EUR', 1018 | ], 1019 | ], 1020 | [ 1021 | 'name' => 'Guam', 1022 | 'alpha2' => 'GU', 1023 | 'alpha3' => 'GUM', 1024 | 'numeric' => '316', 1025 | 'currency' => [ 1026 | 'USD', 1027 | ], 1028 | ], 1029 | [ 1030 | 'name' => 'Guatemala', 1031 | 'alpha2' => 'GT', 1032 | 'alpha3' => 'GTM', 1033 | 'numeric' => '320', 1034 | 'currency' => [ 1035 | 'GTQ', 1036 | ], 1037 | ], 1038 | [ 1039 | 'name' => 'Guernsey', 1040 | 'alpha2' => 'GG', 1041 | 'alpha3' => 'GGY', 1042 | 'numeric' => '831', 1043 | 'currency' => [ 1044 | 'GBP', 1045 | ], 1046 | ], 1047 | [ 1048 | 'name' => 'Guinea', 1049 | 'alpha2' => 'GN', 1050 | 'alpha3' => 'GIN', 1051 | 'numeric' => '324', 1052 | 'currency' => [ 1053 | 'GNF', 1054 | ], 1055 | ], 1056 | [ 1057 | 'name' => 'Guinea-Bissau', 1058 | 'alpha2' => 'GW', 1059 | 'alpha3' => 'GNB', 1060 | 'numeric' => '624', 1061 | 'currency' => [ 1062 | 'XOF', 1063 | ], 1064 | ], 1065 | [ 1066 | 'name' => 'Guyana', 1067 | 'alpha2' => 'GY', 1068 | 'alpha3' => 'GUY', 1069 | 'numeric' => '328', 1070 | 'currency' => [ 1071 | 'GYD', 1072 | ], 1073 | ], 1074 | [ 1075 | 'name' => 'Haiti', 1076 | 'alpha2' => 'HT', 1077 | 'alpha3' => 'HTI', 1078 | 'numeric' => '332', 1079 | 'currency' => [ 1080 | 'HTG', 1081 | ], 1082 | ], 1083 | [ 1084 | 'name' => 'Heard Island and McDonald Islands', 1085 | 'alpha2' => 'HM', 1086 | 'alpha3' => 'HMD', 1087 | 'numeric' => '334', 1088 | 'currency' => [ 1089 | 'AUD', 1090 | ], 1091 | ], 1092 | [ 1093 | 'name' => 'Holy See', 1094 | 'alpha2' => 'VA', 1095 | 'alpha3' => 'VAT', 1096 | 'numeric' => '336', 1097 | 'currency' => [ 1098 | 'EUR', 1099 | ], 1100 | ], 1101 | [ 1102 | 'name' => 'Honduras', 1103 | 'alpha2' => 'HN', 1104 | 'alpha3' => 'HND', 1105 | 'numeric' => '340', 1106 | 'currency' => [ 1107 | 'HNL', 1108 | ], 1109 | ], 1110 | [ 1111 | 'name' => 'Hong Kong', 1112 | 'alpha2' => 'HK', 1113 | 'alpha3' => 'HKG', 1114 | 'numeric' => '344', 1115 | 'currency' => [ 1116 | 'HKD', 1117 | ], 1118 | ], 1119 | [ 1120 | 'name' => 'Hungary', 1121 | 'alpha2' => 'HU', 1122 | 'alpha3' => 'HUN', 1123 | 'numeric' => '348', 1124 | 'currency' => [ 1125 | 'HUF', 1126 | ], 1127 | ], 1128 | [ 1129 | 'name' => 'Iceland', 1130 | 'alpha2' => 'IS', 1131 | 'alpha3' => 'ISL', 1132 | 'numeric' => '352', 1133 | 'currency' => [ 1134 | 'ISK', 1135 | ], 1136 | ], 1137 | [ 1138 | 'name' => 'India', 1139 | 'alpha2' => 'IN', 1140 | 'alpha3' => 'IND', 1141 | 'numeric' => '356', 1142 | 'currency' => [ 1143 | 'INR', 1144 | ], 1145 | ], 1146 | [ 1147 | 'name' => 'Indonesia', 1148 | 'alpha2' => 'ID', 1149 | 'alpha3' => 'IDN', 1150 | 'numeric' => '360', 1151 | 'currency' => [ 1152 | 'IDR', 1153 | ], 1154 | ], 1155 | [ 1156 | 'name' => 'Iran (Islamic Republic of)', 1157 | 'alpha2' => 'IR', 1158 | 'alpha3' => 'IRN', 1159 | 'numeric' => '364', 1160 | 'currency' => [ 1161 | 'IRR', 1162 | ], 1163 | ], 1164 | [ 1165 | 'name' => 'Iraq', 1166 | 'alpha2' => 'IQ', 1167 | 'alpha3' => 'IRQ', 1168 | 'numeric' => '368', 1169 | 'currency' => [ 1170 | 'IQD', 1171 | ], 1172 | ], 1173 | [ 1174 | 'name' => 'Ireland', 1175 | 'alpha2' => 'IE', 1176 | 'alpha3' => 'IRL', 1177 | 'numeric' => '372', 1178 | 'currency' => [ 1179 | 'EUR', 1180 | ], 1181 | ], 1182 | [ 1183 | 'name' => 'Isle of Man', 1184 | 'alpha2' => 'IM', 1185 | 'alpha3' => 'IMN', 1186 | 'numeric' => '833', 1187 | 'currency' => [ 1188 | 'GBP', 1189 | ], 1190 | ], 1191 | [ 1192 | 'name' => 'Israel', 1193 | 'alpha2' => 'IL', 1194 | 'alpha3' => 'ISR', 1195 | 'numeric' => '376', 1196 | 'currency' => [ 1197 | 'ILS', 1198 | ], 1199 | ], 1200 | [ 1201 | 'name' => 'Italy', 1202 | 'alpha2' => 'IT', 1203 | 'alpha3' => 'ITA', 1204 | 'numeric' => '380', 1205 | 'currency' => [ 1206 | 'EUR', 1207 | ], 1208 | ], 1209 | [ 1210 | 'name' => 'Jamaica', 1211 | 'alpha2' => 'JM', 1212 | 'alpha3' => 'JAM', 1213 | 'numeric' => '388', 1214 | 'currency' => [ 1215 | 'JMD', 1216 | ], 1217 | ], 1218 | [ 1219 | 'name' => 'Japan', 1220 | 'alpha2' => 'JP', 1221 | 'alpha3' => 'JPN', 1222 | 'numeric' => '392', 1223 | 'currency' => [ 1224 | 'JPY', 1225 | ], 1226 | ], 1227 | [ 1228 | 'name' => 'Jersey', 1229 | 'alpha2' => 'JE', 1230 | 'alpha3' => 'JEY', 1231 | 'numeric' => '832', 1232 | 'currency' => [ 1233 | 'GBP', 1234 | ], 1235 | ], 1236 | [ 1237 | 'name' => 'Jordan', 1238 | 'alpha2' => 'JO', 1239 | 'alpha3' => 'JOR', 1240 | 'numeric' => '400', 1241 | 'currency' => [ 1242 | 'JOD', 1243 | ], 1244 | ], 1245 | [ 1246 | 'name' => 'Kazakhstan', 1247 | 'alpha2' => 'KZ', 1248 | 'alpha3' => 'KAZ', 1249 | 'numeric' => '398', 1250 | 'currency' => [ 1251 | 'KZT', 1252 | ], 1253 | ], 1254 | [ 1255 | 'name' => 'Kenya', 1256 | 'alpha2' => 'KE', 1257 | 'alpha3' => 'KEN', 1258 | 'numeric' => '404', 1259 | 'currency' => [ 1260 | 'KES', 1261 | ], 1262 | ], 1263 | [ 1264 | 'name' => 'Kiribati', 1265 | 'alpha2' => 'KI', 1266 | 'alpha3' => 'KIR', 1267 | 'numeric' => '296', 1268 | 'currency' => [ 1269 | 'AUD', 1270 | ], 1271 | ], 1272 | [ 1273 | 'name' => 'Korea (Democratic People\'s Republic of)', 1274 | 'alpha2' => 'KP', 1275 | 'alpha3' => 'PRK', 1276 | 'numeric' => '408', 1277 | 'currency' => [ 1278 | 'KPW', 1279 | ], 1280 | ], 1281 | [ 1282 | 'name' => 'Korea (Republic of)', 1283 | 'alpha2' => 'KR', 1284 | 'alpha3' => 'KOR', 1285 | 'numeric' => '410', 1286 | 'currency' => [ 1287 | 'KRW', 1288 | ], 1289 | ], 1290 | [ 1291 | 'name' => 'Kosovo', 1292 | 'alpha2' => 'XK', 1293 | 'alpha3' => 'XKX', 1294 | 'numeric' => '412', 1295 | 'currency' => [ 1296 | 'EUR', 1297 | ], 1298 | ], 1299 | [ 1300 | 'name' => 'Kuwait', 1301 | 'alpha2' => 'KW', 1302 | 'alpha3' => 'KWT', 1303 | 'numeric' => '414', 1304 | 'currency' => [ 1305 | 'KWD', 1306 | ], 1307 | ], 1308 | [ 1309 | 'name' => 'Kyrgyzstan', 1310 | 'alpha2' => 'KG', 1311 | 'alpha3' => 'KGZ', 1312 | 'numeric' => '417', 1313 | 'currency' => [ 1314 | 'KGS', 1315 | ], 1316 | ], 1317 | [ 1318 | 'name' => 'Lao People\'s Democratic Republic', 1319 | 'alpha2' => 'LA', 1320 | 'alpha3' => 'LAO', 1321 | 'numeric' => '418', 1322 | 'currency' => [ 1323 | 'LAK', 1324 | ], 1325 | ], 1326 | [ 1327 | 'name' => 'Latvia', 1328 | 'alpha2' => 'LV', 1329 | 'alpha3' => 'LVA', 1330 | 'numeric' => '428', 1331 | 'currency' => [ 1332 | 'EUR', 1333 | ], 1334 | ], 1335 | [ 1336 | 'name' => 'Lebanon', 1337 | 'alpha2' => 'LB', 1338 | 'alpha3' => 'LBN', 1339 | 'numeric' => '422', 1340 | 'currency' => [ 1341 | 'LBP', 1342 | ], 1343 | ], 1344 | [ 1345 | 'name' => 'Lesotho', 1346 | 'alpha2' => 'LS', 1347 | 'alpha3' => 'LSO', 1348 | 'numeric' => '426', 1349 | 'currency' => [ 1350 | 'LSL', 1351 | 'ZAR', 1352 | ], 1353 | ], 1354 | [ 1355 | 'name' => 'Liberia', 1356 | 'alpha2' => 'LR', 1357 | 'alpha3' => 'LBR', 1358 | 'numeric' => '430', 1359 | 'currency' => [ 1360 | 'LRD', 1361 | ], 1362 | ], 1363 | [ 1364 | 'name' => 'Libya', 1365 | 'alpha2' => 'LY', 1366 | 'alpha3' => 'LBY', 1367 | 'numeric' => '434', 1368 | 'currency' => [ 1369 | 'LYD', 1370 | ], 1371 | ], 1372 | [ 1373 | 'name' => 'Liechtenstein', 1374 | 'alpha2' => 'LI', 1375 | 'alpha3' => 'LIE', 1376 | 'numeric' => '438', 1377 | 'currency' => [ 1378 | 'CHF', 1379 | ], 1380 | ], 1381 | [ 1382 | 'name' => 'Lithuania', 1383 | 'alpha2' => 'LT', 1384 | 'alpha3' => 'LTU', 1385 | 'numeric' => '440', 1386 | 'currency' => [ 1387 | 'EUR', 1388 | ], 1389 | ], 1390 | [ 1391 | 'name' => 'Luxembourg', 1392 | 'alpha2' => 'LU', 1393 | 'alpha3' => 'LUX', 1394 | 'numeric' => '442', 1395 | 'currency' => [ 1396 | 'EUR', 1397 | ], 1398 | ], 1399 | [ 1400 | 'name' => 'Macao', 1401 | 'alpha2' => 'MO', 1402 | 'alpha3' => 'MAC', 1403 | 'numeric' => '446', 1404 | 'currency' => [ 1405 | 'MOP', 1406 | ], 1407 | ], 1408 | [ 1409 | 'name' => 'North Macedonia', 1410 | 'alpha2' => 'MK', 1411 | 'alpha3' => 'MKD', 1412 | 'numeric' => '807', 1413 | 'currency' => [ 1414 | 'MKD', 1415 | ], 1416 | ], 1417 | [ 1418 | 'name' => 'Madagascar', 1419 | 'alpha2' => 'MG', 1420 | 'alpha3' => 'MDG', 1421 | 'numeric' => '450', 1422 | 'currency' => [ 1423 | 'MGA', 1424 | ], 1425 | ], 1426 | [ 1427 | 'name' => 'Malawi', 1428 | 'alpha2' => 'MW', 1429 | 'alpha3' => 'MWI', 1430 | 'numeric' => '454', 1431 | 'currency' => [ 1432 | 'MWK', 1433 | ], 1434 | ], 1435 | [ 1436 | 'name' => 'Malaysia', 1437 | 'alpha2' => 'MY', 1438 | 'alpha3' => 'MYS', 1439 | 'numeric' => '458', 1440 | 'currency' => [ 1441 | 'MYR', 1442 | ], 1443 | ], 1444 | [ 1445 | 'name' => 'Maldives', 1446 | 'alpha2' => 'MV', 1447 | 'alpha3' => 'MDV', 1448 | 'numeric' => '462', 1449 | 'currency' => [ 1450 | 'MVR', 1451 | ], 1452 | ], 1453 | [ 1454 | 'name' => 'Mali', 1455 | 'alpha2' => 'ML', 1456 | 'alpha3' => 'MLI', 1457 | 'numeric' => '466', 1458 | 'currency' => [ 1459 | 'XOF', 1460 | ], 1461 | ], 1462 | [ 1463 | 'name' => 'Malta', 1464 | 'alpha2' => 'MT', 1465 | 'alpha3' => 'MLT', 1466 | 'numeric' => '470', 1467 | 'currency' => [ 1468 | 'EUR', 1469 | ], 1470 | ], 1471 | [ 1472 | 'name' => 'Marshall Islands', 1473 | 'alpha2' => 'MH', 1474 | 'alpha3' => 'MHL', 1475 | 'numeric' => '584', 1476 | 'currency' => [ 1477 | 'USD', 1478 | ], 1479 | ], 1480 | [ 1481 | 'name' => 'Martinique', 1482 | 'alpha2' => 'MQ', 1483 | 'alpha3' => 'MTQ', 1484 | 'numeric' => '474', 1485 | 'currency' => [ 1486 | 'EUR', 1487 | ], 1488 | ], 1489 | [ 1490 | 'name' => 'Mauritania', 1491 | 'alpha2' => 'MR', 1492 | 'alpha3' => 'MRT', 1493 | 'numeric' => '478', 1494 | 'currency' => [ 1495 | 'MRO', 1496 | ], 1497 | ], 1498 | [ 1499 | 'name' => 'Mauritius', 1500 | 'alpha2' => 'MU', 1501 | 'alpha3' => 'MUS', 1502 | 'numeric' => '480', 1503 | 'currency' => [ 1504 | 'MUR', 1505 | ], 1506 | ], 1507 | [ 1508 | 'name' => 'Mayotte', 1509 | 'alpha2' => 'YT', 1510 | 'alpha3' => 'MYT', 1511 | 'numeric' => '175', 1512 | 'currency' => [ 1513 | 'EUR', 1514 | ], 1515 | ], 1516 | [ 1517 | 'name' => 'Mexico', 1518 | 'alpha2' => 'MX', 1519 | 'alpha3' => 'MEX', 1520 | 'numeric' => '484', 1521 | 'currency' => [ 1522 | 'MXN', 1523 | ], 1524 | ], 1525 | [ 1526 | 'name' => 'Micronesia (Federated States of)', 1527 | 'alpha2' => 'FM', 1528 | 'alpha3' => 'FSM', 1529 | 'numeric' => '583', 1530 | 'currency' => [ 1531 | 'USD', 1532 | ], 1533 | ], 1534 | [ 1535 | 'name' => 'Moldova (Republic of)', 1536 | 'alpha2' => 'MD', 1537 | 'alpha3' => 'MDA', 1538 | 'numeric' => '498', 1539 | 'currency' => [ 1540 | 'MDL', 1541 | ], 1542 | ], 1543 | [ 1544 | 'name' => 'Monaco', 1545 | 'alpha2' => 'MC', 1546 | 'alpha3' => 'MCO', 1547 | 'numeric' => '492', 1548 | 'currency' => [ 1549 | 'EUR', 1550 | ], 1551 | ], 1552 | [ 1553 | 'name' => 'Mongolia', 1554 | 'alpha2' => 'MN', 1555 | 'alpha3' => 'MNG', 1556 | 'numeric' => '496', 1557 | 'currency' => [ 1558 | 'MNT', 1559 | ], 1560 | ], 1561 | [ 1562 | 'name' => 'Montenegro', 1563 | 'alpha2' => 'ME', 1564 | 'alpha3' => 'MNE', 1565 | 'numeric' => '499', 1566 | 'currency' => [ 1567 | 'EUR', 1568 | ], 1569 | ], 1570 | [ 1571 | 'name' => 'Montserrat', 1572 | 'alpha2' => 'MS', 1573 | 'alpha3' => 'MSR', 1574 | 'numeric' => '500', 1575 | 'currency' => [ 1576 | 'XCD', 1577 | ], 1578 | ], 1579 | [ 1580 | 'name' => 'Morocco', 1581 | 'alpha2' => 'MA', 1582 | 'alpha3' => 'MAR', 1583 | 'numeric' => '504', 1584 | 'currency' => [ 1585 | 'MAD', 1586 | ], 1587 | ], 1588 | [ 1589 | 'name' => 'Mozambique', 1590 | 'alpha2' => 'MZ', 1591 | 'alpha3' => 'MOZ', 1592 | 'numeric' => '508', 1593 | 'currency' => [ 1594 | 'MZN', 1595 | ], 1596 | ], 1597 | [ 1598 | 'name' => 'Myanmar', 1599 | 'alpha2' => 'MM', 1600 | 'alpha3' => 'MMR', 1601 | 'numeric' => '104', 1602 | 'currency' => [ 1603 | 'MMK', 1604 | ], 1605 | ], 1606 | [ 1607 | 'name' => 'Namibia', 1608 | 'alpha2' => 'NA', 1609 | 'alpha3' => 'NAM', 1610 | 'numeric' => '516', 1611 | 'currency' => [ 1612 | 'NAD', 1613 | 'ZAR', 1614 | ], 1615 | ], 1616 | [ 1617 | 'name' => 'Nauru', 1618 | 'alpha2' => 'NR', 1619 | 'alpha3' => 'NRU', 1620 | 'numeric' => '520', 1621 | 'currency' => [ 1622 | 'AUD', 1623 | ], 1624 | ], 1625 | [ 1626 | 'name' => 'Nepal', 1627 | 'alpha2' => 'NP', 1628 | 'alpha3' => 'NPL', 1629 | 'numeric' => '524', 1630 | 'currency' => [ 1631 | 'NPR', 1632 | ], 1633 | ], 1634 | [ 1635 | 'name' => 'Netherlands', 1636 | 'alpha2' => 'NL', 1637 | 'alpha3' => 'NLD', 1638 | 'numeric' => '528', 1639 | 'currency' => [ 1640 | 'EUR', 1641 | ], 1642 | ], 1643 | [ 1644 | 'name' => 'New Caledonia', 1645 | 'alpha2' => 'NC', 1646 | 'alpha3' => 'NCL', 1647 | 'numeric' => '540', 1648 | 'currency' => [ 1649 | 'XPF', 1650 | ], 1651 | ], 1652 | [ 1653 | 'name' => 'New Zealand', 1654 | 'alpha2' => 'NZ', 1655 | 'alpha3' => 'NZL', 1656 | 'numeric' => '554', 1657 | 'currency' => [ 1658 | 'NZD', 1659 | ], 1660 | ], 1661 | [ 1662 | 'name' => 'Nicaragua', 1663 | 'alpha2' => 'NI', 1664 | 'alpha3' => 'NIC', 1665 | 'numeric' => '558', 1666 | 'currency' => [ 1667 | 'NIO', 1668 | ], 1669 | ], 1670 | [ 1671 | 'name' => 'Niger', 1672 | 'alpha2' => 'NE', 1673 | 'alpha3' => 'NER', 1674 | 'numeric' => '562', 1675 | 'currency' => [ 1676 | 'XOF', 1677 | ], 1678 | ], 1679 | [ 1680 | 'name' => 'Nigeria', 1681 | 'alpha2' => 'NG', 1682 | 'alpha3' => 'NGA', 1683 | 'numeric' => '566', 1684 | 'currency' => [ 1685 | 'NGN', 1686 | ], 1687 | ], 1688 | [ 1689 | 'name' => 'Niue', 1690 | 'alpha2' => 'NU', 1691 | 'alpha3' => 'NIU', 1692 | 'numeric' => '570', 1693 | 'currency' => [ 1694 | 'NZD', 1695 | ], 1696 | ], 1697 | [ 1698 | 'name' => 'Norfolk Island', 1699 | 'alpha2' => 'NF', 1700 | 'alpha3' => 'NFK', 1701 | 'numeric' => '574', 1702 | 'currency' => [ 1703 | 'AUD', 1704 | ], 1705 | ], 1706 | [ 1707 | 'name' => 'Northern Mariana Islands', 1708 | 'alpha2' => 'MP', 1709 | 'alpha3' => 'MNP', 1710 | 'numeric' => '580', 1711 | 'currency' => [ 1712 | 'USD', 1713 | ], 1714 | ], 1715 | [ 1716 | 'name' => 'Norway', 1717 | 'alpha2' => 'NO', 1718 | 'alpha3' => 'NOR', 1719 | 'numeric' => '578', 1720 | 'currency' => [ 1721 | 'NOK', 1722 | ], 1723 | ], 1724 | [ 1725 | 'name' => 'Oman', 1726 | 'alpha2' => 'OM', 1727 | 'alpha3' => 'OMN', 1728 | 'numeric' => '512', 1729 | 'currency' => [ 1730 | 'OMR', 1731 | ], 1732 | ], 1733 | [ 1734 | 'name' => 'Pakistan', 1735 | 'alpha2' => 'PK', 1736 | 'alpha3' => 'PAK', 1737 | 'numeric' => '586', 1738 | 'currency' => [ 1739 | 'PKR', 1740 | ], 1741 | ], 1742 | [ 1743 | 'name' => 'Palau', 1744 | 'alpha2' => 'PW', 1745 | 'alpha3' => 'PLW', 1746 | 'numeric' => '585', 1747 | 'currency' => [ 1748 | 'USD', 1749 | ], 1750 | ], 1751 | [ 1752 | 'name' => 'Palestine, State of', 1753 | 'alpha2' => 'PS', 1754 | 'alpha3' => 'PSE', 1755 | 'numeric' => '275', 1756 | 'currency' => [ 1757 | 'ILS', 1758 | ], 1759 | ], 1760 | [ 1761 | 'name' => 'Panama', 1762 | 'alpha2' => 'PA', 1763 | 'alpha3' => 'PAN', 1764 | 'numeric' => '591', 1765 | 'currency' => [ 1766 | 'PAB', 1767 | ], 1768 | ], 1769 | [ 1770 | 'name' => 'Papua New Guinea', 1771 | 'alpha2' => 'PG', 1772 | 'alpha3' => 'PNG', 1773 | 'numeric' => '598', 1774 | 'currency' => [ 1775 | 'PGK', 1776 | ], 1777 | ], 1778 | [ 1779 | 'name' => 'Paraguay', 1780 | 'alpha2' => 'PY', 1781 | 'alpha3' => 'PRY', 1782 | 'numeric' => '600', 1783 | 'currency' => [ 1784 | 'PYG', 1785 | ], 1786 | ], 1787 | [ 1788 | 'name' => 'Peru', 1789 | 'alpha2' => 'PE', 1790 | 'alpha3' => 'PER', 1791 | 'numeric' => '604', 1792 | 'currency' => [ 1793 | 'PEN', 1794 | ], 1795 | ], 1796 | [ 1797 | 'name' => 'Philippines', 1798 | 'alpha2' => 'PH', 1799 | 'alpha3' => 'PHL', 1800 | 'numeric' => '608', 1801 | 'currency' => [ 1802 | 'PHP', 1803 | ], 1804 | ], 1805 | [ 1806 | 'name' => 'Pitcairn', 1807 | 'alpha2' => 'PN', 1808 | 'alpha3' => 'PCN', 1809 | 'numeric' => '612', 1810 | 'currency' => [ 1811 | 'NZD', 1812 | ], 1813 | ], 1814 | [ 1815 | 'name' => 'Poland', 1816 | 'alpha2' => 'PL', 1817 | 'alpha3' => 'POL', 1818 | 'numeric' => '616', 1819 | 'currency' => [ 1820 | 'PLN', 1821 | ], 1822 | ], 1823 | [ 1824 | 'name' => 'Portugal', 1825 | 'alpha2' => 'PT', 1826 | 'alpha3' => 'PRT', 1827 | 'numeric' => '620', 1828 | 'currency' => [ 1829 | 'EUR', 1830 | ], 1831 | ], 1832 | [ 1833 | 'name' => 'Puerto Rico', 1834 | 'alpha2' => 'PR', 1835 | 'alpha3' => 'PRI', 1836 | 'numeric' => '630', 1837 | 'currency' => [ 1838 | 'USD', 1839 | ], 1840 | ], 1841 | [ 1842 | 'name' => 'Qatar', 1843 | 'alpha2' => 'QA', 1844 | 'alpha3' => 'QAT', 1845 | 'numeric' => '634', 1846 | 'currency' => [ 1847 | 'QAR', 1848 | ], 1849 | ], 1850 | [ 1851 | 'name' => 'Réunion', 1852 | 'alpha2' => 'RE', 1853 | 'alpha3' => 'REU', 1854 | 'numeric' => '638', 1855 | 'currency' => [ 1856 | 'EUR', 1857 | ], 1858 | ], 1859 | [ 1860 | 'name' => 'Romania', 1861 | 'alpha2' => 'RO', 1862 | 'alpha3' => 'ROU', 1863 | 'numeric' => '642', 1864 | 'currency' => [ 1865 | 'RON', 1866 | ], 1867 | ], 1868 | [ 1869 | 'name' => 'Russian Federation', 1870 | 'alpha2' => 'RU', 1871 | 'alpha3' => 'RUS', 1872 | 'numeric' => '643', 1873 | 'currency' => [ 1874 | 'RUB', 1875 | ], 1876 | ], 1877 | [ 1878 | 'name' => 'Rwanda', 1879 | 'alpha2' => 'RW', 1880 | 'alpha3' => 'RWA', 1881 | 'numeric' => '646', 1882 | 'currency' => [ 1883 | 'RWF', 1884 | ], 1885 | ], 1886 | [ 1887 | 'name' => 'Saint Barthélemy', 1888 | 'alpha2' => 'BL', 1889 | 'alpha3' => 'BLM', 1890 | 'numeric' => '652', 1891 | 'currency' => [ 1892 | 'EUR', 1893 | ], 1894 | ], 1895 | [ 1896 | 'name' => 'Saint Helena, Ascension and Tristan da Cunha', 1897 | 'alpha2' => 'SH', 1898 | 'alpha3' => 'SHN', 1899 | 'numeric' => '654', 1900 | 'currency' => [ 1901 | 'SHP', 1902 | ], 1903 | ], 1904 | [ 1905 | 'name' => 'Saint Kitts and Nevis', 1906 | 'alpha2' => 'KN', 1907 | 'alpha3' => 'KNA', 1908 | 'numeric' => '659', 1909 | 'currency' => [ 1910 | 'XCD', 1911 | ], 1912 | ], 1913 | [ 1914 | 'name' => 'Saint Lucia', 1915 | 'alpha2' => 'LC', 1916 | 'alpha3' => 'LCA', 1917 | 'numeric' => '662', 1918 | 'currency' => [ 1919 | 'XCD', 1920 | ], 1921 | ], 1922 | [ 1923 | 'name' => 'Saint Martin (French part)', 1924 | 'alpha2' => 'MF', 1925 | 'alpha3' => 'MAF', 1926 | 'numeric' => '663', 1927 | 'currency' => [ 1928 | 'EUR', 1929 | 'USD', 1930 | ], 1931 | ], 1932 | [ 1933 | 'name' => 'Saint Pierre and Miquelon', 1934 | 'alpha2' => 'PM', 1935 | 'alpha3' => 'SPM', 1936 | 'numeric' => '666', 1937 | 'currency' => [ 1938 | 'EUR', 1939 | ], 1940 | ], 1941 | [ 1942 | 'name' => 'Saint Vincent and the Grenadines', 1943 | 'alpha2' => 'VC', 1944 | 'alpha3' => 'VCT', 1945 | 'numeric' => '670', 1946 | 'currency' => [ 1947 | 'XCD', 1948 | ], 1949 | ], 1950 | [ 1951 | 'name' => 'Samoa', 1952 | 'alpha2' => 'WS', 1953 | 'alpha3' => 'WSM', 1954 | 'numeric' => '882', 1955 | 'currency' => [ 1956 | 'WST', 1957 | ], 1958 | ], 1959 | [ 1960 | 'name' => 'San Marino', 1961 | 'alpha2' => 'SM', 1962 | 'alpha3' => 'SMR', 1963 | 'numeric' => '674', 1964 | 'currency' => [ 1965 | 'EUR', 1966 | ], 1967 | ], 1968 | [ 1969 | 'name' => 'Sao Tome and Principe', 1970 | 'alpha2' => 'ST', 1971 | 'alpha3' => 'STP', 1972 | 'numeric' => '678', 1973 | 'currency' => [ 1974 | 'STD', 1975 | ], 1976 | ], 1977 | [ 1978 | 'name' => 'Saudi Arabia', 1979 | 'alpha2' => 'SA', 1980 | 'alpha3' => 'SAU', 1981 | 'numeric' => '682', 1982 | 'currency' => [ 1983 | 'SAR', 1984 | ], 1985 | ], 1986 | [ 1987 | 'name' => 'Senegal', 1988 | 'alpha2' => 'SN', 1989 | 'alpha3' => 'SEN', 1990 | 'numeric' => '686', 1991 | 'currency' => [ 1992 | 'XOF', 1993 | ], 1994 | ], 1995 | [ 1996 | 'name' => 'Serbia', 1997 | 'alpha2' => 'RS', 1998 | 'alpha3' => 'SRB', 1999 | 'numeric' => '688', 2000 | 'currency' => [ 2001 | 'RSD', 2002 | ], 2003 | ], 2004 | [ 2005 | 'name' => 'Seychelles', 2006 | 'alpha2' => 'SC', 2007 | 'alpha3' => 'SYC', 2008 | 'numeric' => '690', 2009 | 'currency' => [ 2010 | 'SCR', 2011 | ], 2012 | ], 2013 | [ 2014 | 'name' => 'Sierra Leone', 2015 | 'alpha2' => 'SL', 2016 | 'alpha3' => 'SLE', 2017 | 'numeric' => '694', 2018 | 'currency' => [ 2019 | 'SLL', 2020 | ], 2021 | ], 2022 | [ 2023 | 'name' => 'Singapore', 2024 | 'alpha2' => 'SG', 2025 | 'alpha3' => 'SGP', 2026 | 'numeric' => '702', 2027 | 'currency' => [ 2028 | 'SGD', 2029 | ], 2030 | ], 2031 | [ 2032 | 'name' => 'Sint Maarten (Dutch part)', 2033 | 'alpha2' => 'SX', 2034 | 'alpha3' => 'SXM', 2035 | 'numeric' => '534', 2036 | 'currency' => [ 2037 | 'ANG', 2038 | ], 2039 | ], 2040 | [ 2041 | 'name' => 'Slovakia', 2042 | 'alpha2' => 'SK', 2043 | 'alpha3' => 'SVK', 2044 | 'numeric' => '703', 2045 | 'currency' => [ 2046 | 'EUR', 2047 | ], 2048 | ], 2049 | [ 2050 | 'name' => 'Slovenia', 2051 | 'alpha2' => 'SI', 2052 | 'alpha3' => 'SVN', 2053 | 'numeric' => '705', 2054 | 'currency' => [ 2055 | 'EUR', 2056 | ], 2057 | ], 2058 | [ 2059 | 'name' => 'Solomon Islands', 2060 | 'alpha2' => 'SB', 2061 | 'alpha3' => 'SLB', 2062 | 'numeric' => '090', 2063 | 'currency' => [ 2064 | 'SBD', 2065 | ], 2066 | ], 2067 | [ 2068 | 'name' => 'Somalia', 2069 | 'alpha2' => 'SO', 2070 | 'alpha3' => 'SOM', 2071 | 'numeric' => '706', 2072 | 'currency' => [ 2073 | 'SOS', 2074 | ], 2075 | ], 2076 | [ 2077 | 'name' => 'South Africa', 2078 | 'alpha2' => 'ZA', 2079 | 'alpha3' => 'ZAF', 2080 | 'numeric' => '710', 2081 | 'currency' => [ 2082 | 'ZAR', 2083 | ], 2084 | ], 2085 | [ 2086 | 'name' => 'South Georgia and the South Sandwich Islands', 2087 | 'alpha2' => 'GS', 2088 | 'alpha3' => 'SGS', 2089 | 'numeric' => '239', 2090 | 'currency' => [ 2091 | 'GBP', 2092 | ], 2093 | ], 2094 | [ 2095 | 'name' => 'South Sudan', 2096 | 'alpha2' => 'SS', 2097 | 'alpha3' => 'SSD', 2098 | 'numeric' => '728', 2099 | 'currency' => [ 2100 | 'SSP', 2101 | ], 2102 | ], 2103 | [ 2104 | 'name' => 'Spain', 2105 | 'alpha2' => 'ES', 2106 | 'alpha3' => 'ESP', 2107 | 'numeric' => '724', 2108 | 'currency' => [ 2109 | 'EUR', 2110 | ], 2111 | ], 2112 | [ 2113 | 'name' => 'Sri Lanka', 2114 | 'alpha2' => 'LK', 2115 | 'alpha3' => 'LKA', 2116 | 'numeric' => '144', 2117 | 'currency' => [ 2118 | 'LKR', 2119 | ], 2120 | ], 2121 | [ 2122 | 'name' => 'Sudan', 2123 | 'alpha2' => 'SD', 2124 | 'alpha3' => 'SDN', 2125 | 'numeric' => '729', 2126 | 'currency' => [ 2127 | 'SDG', 2128 | ], 2129 | ], 2130 | [ 2131 | 'name' => 'Suriname', 2132 | 'alpha2' => 'SR', 2133 | 'alpha3' => 'SUR', 2134 | 'numeric' => '740', 2135 | 'currency' => [ 2136 | 'SRD', 2137 | ], 2138 | ], 2139 | [ 2140 | 'name' => 'Svalbard and Jan Mayen', 2141 | 'alpha2' => 'SJ', 2142 | 'alpha3' => 'SJM', 2143 | 'numeric' => '744', 2144 | 'currency' => [ 2145 | 'NOK', 2146 | ], 2147 | ], 2148 | [ 2149 | 'name' => 'Sweden', 2150 | 'alpha2' => 'SE', 2151 | 'alpha3' => 'SWE', 2152 | 'numeric' => '752', 2153 | 'currency' => [ 2154 | 'SEK', 2155 | ], 2156 | ], 2157 | [ 2158 | 'name' => 'Switzerland', 2159 | 'alpha2' => 'CH', 2160 | 'alpha3' => 'CHE', 2161 | 'numeric' => '756', 2162 | 'currency' => [ 2163 | 'CHF', 2164 | ], 2165 | ], 2166 | [ 2167 | 'name' => 'Syrian Arab Republic', 2168 | 'alpha2' => 'SY', 2169 | 'alpha3' => 'SYR', 2170 | 'numeric' => '760', 2171 | 'currency' => [ 2172 | 'SYP', 2173 | ], 2174 | ], 2175 | [ 2176 | 'name' => 'Taiwan (Province of China)', 2177 | 'alpha2' => 'TW', 2178 | 'alpha3' => 'TWN', 2179 | 'numeric' => '158', 2180 | 'currency' => [ 2181 | 'TWD', 2182 | ], 2183 | ], 2184 | [ 2185 | 'name' => 'Tajikistan', 2186 | 'alpha2' => 'TJ', 2187 | 'alpha3' => 'TJK', 2188 | 'numeric' => '762', 2189 | 'currency' => [ 2190 | 'TJS', 2191 | ], 2192 | ], 2193 | [ 2194 | 'name' => 'Tanzania, United Republic of', 2195 | 'alpha2' => 'TZ', 2196 | 'alpha3' => 'TZA', 2197 | 'numeric' => '834', 2198 | 'currency' => [ 2199 | 'TZS', 2200 | ], 2201 | ], 2202 | [ 2203 | 'name' => 'Thailand', 2204 | 'alpha2' => 'TH', 2205 | 'alpha3' => 'THA', 2206 | 'numeric' => '764', 2207 | 'currency' => [ 2208 | 'THB', 2209 | ], 2210 | ], 2211 | [ 2212 | 'name' => 'Timor-Leste', 2213 | 'alpha2' => 'TL', 2214 | 'alpha3' => 'TLS', 2215 | 'numeric' => '626', 2216 | 'currency' => [ 2217 | 'USD', 2218 | ], 2219 | ], 2220 | [ 2221 | 'name' => 'Togo', 2222 | 'alpha2' => 'TG', 2223 | 'alpha3' => 'TGO', 2224 | 'numeric' => '768', 2225 | 'currency' => [ 2226 | 'XOF', 2227 | ], 2228 | ], 2229 | [ 2230 | 'name' => 'Tokelau', 2231 | 'alpha2' => 'TK', 2232 | 'alpha3' => 'TKL', 2233 | 'numeric' => '772', 2234 | 'currency' => [ 2235 | 'NZD', 2236 | ], 2237 | ], 2238 | [ 2239 | 'name' => 'Tonga', 2240 | 'alpha2' => 'TO', 2241 | 'alpha3' => 'TON', 2242 | 'numeric' => '776', 2243 | 'currency' => [ 2244 | 'TOP', 2245 | ], 2246 | ], 2247 | [ 2248 | 'name' => 'Trinidad and Tobago', 2249 | 'alpha2' => 'TT', 2250 | 'alpha3' => 'TTO', 2251 | 'numeric' => '780', 2252 | 'currency' => [ 2253 | 'TTD', 2254 | ], 2255 | ], 2256 | [ 2257 | 'name' => 'Tunisia', 2258 | 'alpha2' => 'TN', 2259 | 'alpha3' => 'TUN', 2260 | 'numeric' => '788', 2261 | 'currency' => [ 2262 | 'TND', 2263 | ], 2264 | ], 2265 | [ 2266 | 'name' => 'Türkiye', 2267 | 'alpha2' => 'TR', 2268 | 'alpha3' => 'TUR', 2269 | 'numeric' => '792', 2270 | 'currency' => [ 2271 | 'TRY', 2272 | ], 2273 | ], 2274 | [ 2275 | 'name' => 'Turkmenistan', 2276 | 'alpha2' => 'TM', 2277 | 'alpha3' => 'TKM', 2278 | 'numeric' => '795', 2279 | 'currency' => [ 2280 | 'TMT', 2281 | ], 2282 | ], 2283 | [ 2284 | 'name' => 'Turks and Caicos Islands', 2285 | 'alpha2' => 'TC', 2286 | 'alpha3' => 'TCA', 2287 | 'numeric' => '796', 2288 | 'currency' => [ 2289 | 'USD', 2290 | ], 2291 | ], 2292 | [ 2293 | 'name' => 'Tuvalu', 2294 | 'alpha2' => 'TV', 2295 | 'alpha3' => 'TUV', 2296 | 'numeric' => '798', 2297 | 'currency' => [ 2298 | 'AUD', 2299 | ], 2300 | ], 2301 | [ 2302 | 'name' => 'Uganda', 2303 | 'alpha2' => 'UG', 2304 | 'alpha3' => 'UGA', 2305 | 'numeric' => '800', 2306 | 'currency' => [ 2307 | 'UGX', 2308 | ], 2309 | ], 2310 | [ 2311 | 'name' => 'Ukraine', 2312 | 'alpha2' => 'UA', 2313 | 'alpha3' => 'UKR', 2314 | 'numeric' => '804', 2315 | 'currency' => [ 2316 | 'UAH', 2317 | ], 2318 | ], 2319 | [ 2320 | 'name' => 'United Arab Emirates', 2321 | 'alpha2' => 'AE', 2322 | 'alpha3' => 'ARE', 2323 | 'numeric' => '784', 2324 | 'currency' => [ 2325 | 'AED', 2326 | ], 2327 | ], 2328 | [ 2329 | 'name' => 'United Kingdom of Great Britain and Northern Ireland', 2330 | 'alpha2' => 'GB', 2331 | 'alpha3' => 'GBR', 2332 | 'numeric' => '826', 2333 | 'currency' => [ 2334 | 'GBP', 2335 | ], 2336 | ], 2337 | [ 2338 | 'name' => 'United States of America', 2339 | 'alpha2' => 'US', 2340 | 'alpha3' => 'USA', 2341 | 'numeric' => '840', 2342 | 'currency' => [ 2343 | 'USD', 2344 | ], 2345 | ], 2346 | [ 2347 | 'name' => 'United States Minor Outlying Islands', 2348 | 'alpha2' => 'UM', 2349 | 'alpha3' => 'UMI', 2350 | 'numeric' => '581', 2351 | 'currency' => [ 2352 | 'USD', 2353 | ], 2354 | ], 2355 | [ 2356 | 'name' => 'Uruguay', 2357 | 'alpha2' => 'UY', 2358 | 'alpha3' => 'URY', 2359 | 'numeric' => '858', 2360 | 'currency' => [ 2361 | 'UYU', 2362 | ], 2363 | ], 2364 | [ 2365 | 'name' => 'Uzbekistan', 2366 | 'alpha2' => 'UZ', 2367 | 'alpha3' => 'UZB', 2368 | 'numeric' => '860', 2369 | 'currency' => [ 2370 | 'UZS', 2371 | ], 2372 | ], 2373 | [ 2374 | 'name' => 'Vanuatu', 2375 | 'alpha2' => 'VU', 2376 | 'alpha3' => 'VUT', 2377 | 'numeric' => '548', 2378 | 'currency' => [ 2379 | 'VUV', 2380 | ], 2381 | ], 2382 | [ 2383 | 'name' => 'Venezuela (Bolivarian Republic of)', 2384 | 'alpha2' => 'VE', 2385 | 'alpha3' => 'VEN', 2386 | 'numeric' => '862', 2387 | 'currency' => [ 2388 | 'VEF', 2389 | ], 2390 | ], 2391 | [ 2392 | 'name' => 'Viet Nam', 2393 | 'alpha2' => 'VN', 2394 | 'alpha3' => 'VNM', 2395 | 'numeric' => '704', 2396 | 'currency' => [ 2397 | 'VND', 2398 | ], 2399 | ], 2400 | [ 2401 | 'name' => 'Virgin Islands (British)', 2402 | 'alpha2' => 'VG', 2403 | 'alpha3' => 'VGB', 2404 | 'numeric' => '092', 2405 | 'currency' => [ 2406 | 'USD', 2407 | ], 2408 | ], 2409 | [ 2410 | 'name' => 'Virgin Islands (U.S.)', 2411 | 'alpha2' => 'VI', 2412 | 'alpha3' => 'VIR', 2413 | 'numeric' => '850', 2414 | 'currency' => [ 2415 | 'USD', 2416 | ], 2417 | ], 2418 | [ 2419 | 'name' => 'Wallis and Futuna', 2420 | 'alpha2' => 'WF', 2421 | 'alpha3' => 'WLF', 2422 | 'numeric' => '876', 2423 | 'currency' => [ 2424 | 'XPF', 2425 | ], 2426 | ], 2427 | [ 2428 | 'name' => 'Western Sahara', 2429 | 'alpha2' => 'EH', 2430 | 'alpha3' => 'ESH', 2431 | 'numeric' => '732', 2432 | 'currency' => [ 2433 | 'MAD', 2434 | ], 2435 | ], 2436 | [ 2437 | 'name' => 'Yemen', 2438 | 'alpha2' => 'YE', 2439 | 'alpha3' => 'YEM', 2440 | 'numeric' => '887', 2441 | 'currency' => [ 2442 | 'YER', 2443 | ], 2444 | ], 2445 | [ 2446 | 'name' => 'Zambia', 2447 | 'alpha2' => 'ZM', 2448 | 'alpha3' => 'ZMB', 2449 | 'numeric' => '894', 2450 | 'currency' => [ 2451 | 'ZMW', 2452 | ], 2453 | ], 2454 | [ 2455 | 'name' => 'Zimbabwe', 2456 | 'alpha2' => 'ZW', 2457 | 'alpha3' => 'ZWE', 2458 | 'numeric' => '716', 2459 | 'currency' => [ 2460 | 'BWP', 2461 | 'EUR', 2462 | 'GBP', 2463 | 'USD', 2464 | 'ZAR', 2465 | ], 2466 | ], 2467 | ]; 2468 | } 2469 | -------------------------------------------------------------------------------- /src/ISO3166DataProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166; 13 | 14 | interface ISO3166DataProvider 15 | { 16 | /** 17 | * Lookup ISO3166-1 data by name identifier. 18 | * 19 | * @api 20 | * 21 | * @throws Exception\OutOfBoundsException if input does not exist in dataset 22 | * 23 | * @return array 24 | */ 25 | public function name(string $name): array; 26 | 27 | /** 28 | * Lookup ISO3166-1 data by alpha2 identifier. 29 | * 30 | * @api 31 | * 32 | * @throws Exception\DomainException if input does not look like an alpha2 key 33 | * @throws Exception\OutOfBoundsException if input does not exist in dataset 34 | * 35 | * @return array 36 | */ 37 | public function alpha2(string $alpha2): array; 38 | 39 | /** 40 | * Lookup ISO3166-1 data by alpha3 identifier. 41 | * 42 | * @api 43 | * 44 | * @throws Exception\DomainException if input does not look like an alpha3 key 45 | * @throws Exception\OutOfBoundsException if input does not exist in dataset 46 | * 47 | * @return array 48 | */ 49 | public function alpha3(string $alpha3): array; 50 | 51 | /** 52 | * Lookup ISO3166-1 data by numeric identifier (numerical string, that is). 53 | * 54 | * @api 55 | * 56 | * @throws Exception\DomainException if input does not look like a numeric key 57 | * @throws Exception\OutOfBoundsException if input does not exist in dataset 58 | * 59 | * @return array 60 | */ 61 | public function numeric(string $numeric): array; 62 | } 63 | -------------------------------------------------------------------------------- /src/ISO3166DataValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166; 13 | 14 | use League\ISO3166\Exception\DomainException; 15 | 16 | final class ISO3166DataValidator 17 | { 18 | /** 19 | * @param array> $data 20 | * 21 | * @return array> 22 | */ 23 | public function validate(array $data): array 24 | { 25 | foreach ($data as $entry) { 26 | $this->assertEntryHasRequiredKeys($entry); 27 | } 28 | 29 | return $data; 30 | } 31 | 32 | /** 33 | * @param array $entry 34 | * 35 | * @throws DomainException if given data entry does not have all the required keys 36 | */ 37 | private function assertEntryHasRequiredKeys(array $entry): void 38 | { 39 | if (!isset($entry[ISO3166::KEY_NAME])) { 40 | throw new DomainException('Each data entry must have a name key.'); 41 | } 42 | 43 | Guards::guardAgainstInvalidName($entry[ISO3166::KEY_NAME]); 44 | 45 | if (!isset($entry[ISO3166::KEY_ALPHA2])) { 46 | throw new DomainException('Each data entry must have a alpha2 key.'); 47 | } 48 | 49 | Guards::guardAgainstInvalidAlpha2($entry[ISO3166::KEY_ALPHA2]); 50 | 51 | if (!isset($entry[ISO3166::KEY_ALPHA3])) { 52 | throw new DomainException('Each data entry must have a alpha3 key.'); 53 | } 54 | 55 | Guards::guardAgainstInvalidAlpha3($entry[ISO3166::KEY_ALPHA3]); 56 | 57 | if (!isset($entry[ISO3166::KEY_NUMERIC])) { 58 | throw new DomainException('Each data entry must have a numeric key.'); 59 | } 60 | 61 | Guards::guardAgainstInvalidNumeric($entry[ISO3166::KEY_NUMERIC]); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/ISO3166WithAliases.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace League\ISO3166; 13 | 14 | class ISO3166WithAliases implements ISO3166DataProvider 15 | { 16 | private ISO3166DataProvider $source; 17 | 18 | /** @var array */ 19 | public const aliases = [ 20 | 'Bolivia' => 'Bolivia (Plurinational State of)', 21 | 'Bolivia, Plurinational State of' => 'Bolivia (Plurinational State of)', 22 | 'Congo-Kinshasa' => 'Congo (Democratic Republic of the)', 23 | 'Congo, Democratic Republic of the' => 'Congo (Democratic Republic of the)', 24 | 'Czech Republic' => 'Czechia', 25 | 'Iran' => 'Iran (Islamic Republic of)', 26 | 'North Korea' => 'Korea (Democratic People\'s Republic of)', 27 | 'South Korea' => 'Korea (Republic of)', 28 | 'Laos' => 'Lao People\'s Democratic Republic', 29 | 'Micronesia' => 'Micronesia (Federated States of)', 30 | 'Moldova' => 'Moldova (Republic of)', 31 | 'Palestine' => 'Palestine, State of', 32 | 'Russia' => 'Russian Federation', 33 | 'Saint Martin' => 'Saint Martin (French part)', 34 | 'Sint Maarten' => 'Sint Maarten (Dutch part)', 35 | 'Taiwan' => 'Taiwan (Province of China)', 36 | 'Tanzania' => 'Tanzania, United Republic of', 37 | 'United Kingdom' => 'United Kingdom of Great Britain and Northern Ireland', 38 | 'United States' => 'United States of America', 39 | 'USA' => 'United States of America', 40 | 'Venezuela' => 'Venezuela (Bolivarian Republic of)', 41 | 'Vietnam' => 'Viet Nam', 42 | ]; 43 | 44 | public function __construct(ISO3166DataProvider $iso3166) 45 | { 46 | $this->source = $iso3166; 47 | } 48 | 49 | public function name(string $name): array 50 | { 51 | foreach (self::aliases as $alias => $original) { 52 | if (0 === strcasecmp($alias, $name)) { 53 | $name = $original; 54 | break; 55 | } 56 | } 57 | 58 | return $this->source->name($name); 59 | } 60 | 61 | public function alpha2(string $alpha2): array 62 | { 63 | return $this->source->alpha2($alpha2); 64 | } 65 | 66 | public function alpha3(string $alpha3): array 67 | { 68 | return $this->source->alpha3($alpha3); 69 | } 70 | 71 | public function numeric(string $numeric): array 72 | { 73 | return $this->source->numeric($numeric); 74 | } 75 | } 76 | --------------------------------------------------------------------------------