PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Peter Kahl   PHP Country Code to Country Name   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Country Code to Country Name
Validate country code and get the respective name
Author: By
Last change: Update of README.md
Date: 4 years ago
Size: 883 bytes
 

Contents

Class file image Download

CountryCode

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