2017 © Pedro Peláez
 

library country-iso

Get localized country names from ISO 3166-1 codes

image

ashterix/country-iso

Get localized country names from ISO 3166-1 codes

  • Monday, March 16, 2015
  • by Ashterix
  • Repository
  • 1 Watchers
  • 0 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ISO 3166

Get localized country names from ISO 3166-1 codes., (*1)

How use?

INIT

~~~~~~ php use CountryIso\ISO3166;, (*2)

$isoCodes = new ISO3166();, (*3)


##### SET COUNTRIES ALIASES ~~~~~~ php // Add an alias for the Vatican $countryCodes->setCountriesAliases([ 'VA' => 'Vatican' ]); // or add some aliases for the Vatican $countryCodes->setCountriesAliases([ 'VA' => [ 'Holy See', 'Vatican', 'Vatican City State' ] ]);
GET DATA

Get country name by code: ~~~~~~ php echo $countryCodes->getCountry("US"); // United States echo $countryCodes->getCountry("UA"); // Ukraine echo $countryCodes->getCountry("ES"); // Spain, (*4)


Get country code by name or aliases: ~~~~~~ php echo $countryCodes->getCountry("Ukraine"); // UA echo $countryCodes->getCountry("United States");// US echo $countryCodes->getCountry("Vatican"); // VA echo $countryCodes->getCountry("Holy See"); // VA

Get map (all countries array): ~~~~~~ php $allCountries = $countryCodes->getMap(); ~~~~~~, (*5)

The Versions

16/03 2015

dev-master

9999999-dev

Get localized country names from ISO 3166-1 codes

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Alex Maystrenko

16/03 2015

1.0.0

1.0.0.0

Get localized country names from ISO 3166-1 codes

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Alex Maystrenko