PHPackages                             rkr/countries - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. rkr/countries

ActiveLibrary[Localization &amp; i18n](/categories/localization)

rkr/countries
=============

A library to help translating country-names into various standards and to text

0.1.5(4y ago)34.2k1MITPHPPHP &gt;= 7.0

Since Dec 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ecommerce-utilities/php-countries)[ Packagist](https://packagist.org/packages/rkr/countries)[ RSS](/packages/rkr-countries/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

rkr/countries
=============

[](#rkrcountries)

[![Build Status](https://camo.githubusercontent.com/562137c1e095b0c4f73f1e5e86bb05045709169bbe36e55cc76f2570a155f215/68747470733a2f2f7472617669732d63692e6f72672f65636f6d6d657263652d7574696c69746965732f7068702d636f756e74726965732e737667)](https://travis-ci.org/ecommerce-utilities/php-countries)[![Latest Stable Version](https://camo.githubusercontent.com/d2f1d14ff1a2338158efa67d5036c3ae1cacd9aa50e36bbac00f71a4fbaf751c/68747470733a2f2f706f7365722e707567782e6f72672f726b722f636f756e74726965732f762f737461626c65)](https://packagist.org/packages/rkr/countries)[![License](https://camo.githubusercontent.com/d436f4bfe0ad4dba8f26a7838e946bf6ea9bb747c5443a71610cea19d9cdcc92/68747470733a2f2f706f7365722e707567782e6f72672f726b722f636f756e74726965732f6c6963656e7365)](https://packagist.org/packages/rkr/countries)

The country-codes are copied from [umpirsky/country-list](https://github.com/umpirsky/country-list). I've only added some code-locators and some translators and removed all those formats not suited for my needs.

Some examples
-------------

[](#some-examples)

### Get all countries

[](#get-all-countries)

```
$provider = new IcuCountryListProvider('en', 'GB');
print_r($provider->getCountries());
```

```
Array
(
    [AF] => Afghanistan
    [AX] => Åland Islands
    [AL] => Albania
    [DZ] => Algeria
    [AS] => American Samoa
    [AD] => Andorra
    [AO] => Angola
    [AI] => Anguilla
    (248 more ...)
)

```

### Get the name of a specific country

[](#get-the-name-of-a-specific-country)

```
$provider = new IcuCountryNameLocator('en', 'GB');
echo $provider->getCountry('DE');
```

`Germany`

### Get all EU-countries:

[](#get-all-eu-countries)

```
$provider = new EuCountryProvider('en', 'GB');
print_r($provider->getList());
```

```
Array
(
    [BE] => Belgium
    [BG] => Bulgaria
    [CZ] => Czech Republic
    [DK] => Denmark
    [DE] => Germany
    [EE] => Estonia
    [IE] => Ireland
    (22 more ...)
)

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~427 days

Recently: every ~502 days

Total

7

Last Release

1666d ago

PHP version history (3 changes)0.0.1PHP &gt;= 5.3

0.1PHP &gt;= 5.4

0.1.5PHP &gt;= 7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f83d7e57a4bf3f1309680dbfbbf2d022f0ee6dae64a4b3bdfbed1226f2f6bef?d=identicon)[rkr](/maintainers/rkr)

---

Top Contributors

[![rkrx](https://avatars.githubusercontent.com/u/5672982?v=4)](https://github.com/rkrx "rkrx (14 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rkr-countries/health.svg)

```
[![Health](https://phpackages.com/badges/rkr-countries/health.svg)](https://phpackages.com/packages/rkr-countries)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
