peterkahl/country-code

Methods for working with 2-character country codes.

v1.2 2019-07-31 07:41 UTC

README

Downloads License If this project has business value for you then don't hesitate to support me with a small donation.

Methods for working with 2-character country codes (validation, name from code).

⚠️CAUTION

When using method getName(), multibyte strings will be returned.

Usage Exaples

use peterkahl\CountryCode\CountryCode;

# Validate a country code string:
if (CountryCode::isValid('uk'))
{
  echo 'valid';
}
else
{
  echo 'invalid';
}

# Get name from country code:
echo CountryCode::getName('RE'); # Réunion