PHPackages                             rkr/postcodes - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rkr/postcodes

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rkr/postcodes
=============

A library to help converting from the outdated post-codes to icu-country-codes, vice versa

0.0.2(6y ago)0416↓100%PHPPHP &gt;= 5.3CI failing

Since Dec 4Pushed 5y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

rkr/postcodes
=============

[](#rkrpostcodes)

A library to help converting from the outdated post-codes to icu-country-codes, vice versa.

Get a postcode for a ICU-code
-----------------------------

[](#get-a-postcode-for-a-icu-code)

```
$provider = new \Kir\PostCodes\PostCodeProvider();
echo $provider->getPostCodeFromIso3166('DE');

```

```
D

```

Get a ICU-Code from a postcode
------------------------------

[](#get-a-icu-code-from-a-postcode)

```
$provider = new \Kir\PostCodes\PostCodeProvider();
echo $provider->getIso3166CodeFromPostCode('D');

```

```
DE

```

Get a list of all available ICU-codes
-------------------------------------

[](#get-a-list-of-all-available-icu-codes)

```
$provider = new \Kir\PostCodes\PostCodeProvider();
echo implode(', ', $provider->getAllIcuCodes());

```

```
AD, AE, AF, AG, AI, AL, AM, AN, AO, AQ, AR, AS, AT, ...

```

Get a list of all available postcodes
-------------------------------------

[](#get-a-list-of-all-available-postcodes)

```
$provider = new \Kir\PostCodes\PostCodeProvider();
echo implode(', ', $provider->getAllPostCodes());

```

```
AND, UAE, AFG, ANT, AIA, AL, ARM, NA, ANG, ...

```

Get a key-value list of all available ICU-codes
-----------------------------------------------

[](#get-a-key-value-list-of-all-available-icu-codes)

```
$provider = new \Kir\PostCodes\PostCodeProvider();

print_r($provider->getIcuCodesToPostcodes());

```

```
['AD' => 'AND', 'AE' => 'UAE', 'AF' => 'AFG', 'AG' => 'ANT', ...]

```

Get a key-value list of all available post-codes
------------------------------------------------

[](#get-a-key-value-list-of-all-available-post-codes)

```
$provider = new \Kir\PostCodes\PostCodeProvider();

print_r($provider->getPostcodesToIcuCodes());

```

```
['AND' => 'AD', 'UAE' => 'AE', 'AFG' => 'AF', 'ANT' => 'AG', ...]

```

###  Health Score

25

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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 ~1729 days

Total

2

Last Release

2397d ago

### 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 (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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