evdw / country-list
This library allow you to get countries names and ISO codes in all languages for php usage.
2.1.0
2018-09-13 15:01 UTC
Requires
- php: ^7.0
This package is auto-updated.
Last update: 2024-04-14 19:52:29 UTC
README
This library allow you to get countries names and ISO codes in all languages for php usage.
Installing
$ composer require evdw/country-list
Using
Get a country names list in a specific language:
use EVDW\CountriesFactory; $countriesFactory = new CountriesFactory; $countriesFactory->getCountries('fr'); // Return a countries array in french
Get a country iso code, by specifying the language in which the country is written:
use EVDW\CountriesFactory; $countriesFactory = new CountriesFactory; $countriesFactory->getIsoCode('fr', 'france'); // Return the french ISO code
If the locale or the country name do not exist, no errors are throw, it returns null or empty array.