Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2019-10-11 (5 hours ago) ![RSS 2.0 feed](/graphics/phpclasses/rss2.png) | | Not yet rated by the users | | Total: 280 | | All time: 7,446 This week: 357![Up](/graphics/phpclasses/up.png) |
|
Description | | Author |
This class can validate country code and get the respective name.
It can take a given country code with two letters and determine if it corresponds to a valid country.
The class can also get the name of a country given the respective two letter code. Innovation Award
![PHP Programming Innovation award nominee PHP Programming Innovation award nominee](/award/innovation/nominee.gif) September 2018
Number 4 |
Many applications need to take the country code as parameter for their own purposes.
This class can take the two letter code of country and determine if it corresponds to a valid code. It can also return the respective country name.
Manuel Lemos |
| |
![Picture of Peter Kahl Picture of Peter Kahl](/graphics/unknown.gif) |
|
Innovation award
![Innovation award](/graphics/phpclasses/innovation-award-logo.png) Nominee: 23x
Winner: 2x |
|
Details
CountryCode
![If this project has business value for you then don't hesitate to support me with a small donation.](https://img.shields.io/badge/Donations-via%20Paypal-blue.svg)
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
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.