PHPackages                             erickskrauch/mcc-mnc - 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. erickskrauch/mcc-mnc

ActiveLibrary

erickskrauch/mcc-mnc
====================

A library to convert MCC to country code and vice-versa

0.2.0(2y ago)1594↓100%MITPHPPHP ^7.4 || ^8.0

Since Apr 25Pushed 2y ago2 watchersCompare

[ Source](https://github.com/erickskrauch/mcc-mnc-php)[ Packagist](https://packagist.org/packages/erickskrauch/mcc-mnc)[ Docs](https://github.com/erickskrauch/mcc-mnc-php)[ RSS](/packages/erickskrauch-mcc-mnc/feed)WikiDiscussions master Synced today

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

PHP database of MCC network ids
===============================

[](#php-database-of-mcc-network-ids)

I couldn't find any existing libraries with [MCC](https://en.wikipedia.org/wiki/Mobile_country_code) identifiers map to their according country. So I made my own. The data is parsed from this [wikipedia](https://en.wikipedia.org/wiki/Mobile_country_code#National_operators) table.

A very rough implementation, but it does exactly what I needed for my job. Feel free to [open an issue](https://github.com/erickskrauch/mcc-mnc/issues/new) with your feature request.

[![Latest Version on Packagist](https://camo.githubusercontent.com/cb4ebf4a8d1837ab6f876e9422bff650b6d2aa1e22e9897a80a60fe60131d32a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657269636b736b72617563682f6d63632d6d6e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erickskrauch/mcc-mnc)[![Build Status](https://camo.githubusercontent.com/67f81eae22e02c8abb06f0ef067354ca8a29e5e281750e21981cf2933df5530b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f657269636b736b72617563682f6d63632d6d6e632d7068702f63692e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/erickskrauch/mcc-mnc-php/actions)[![Changelog](https://camo.githubusercontent.com/f682e0d1ff9dd815b94c09f7c45da9d98e44e51b15a0cbefee06930b4f0c0490/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6368616e67656c6f672d4b656570253230612532304368616e67656c6f672d2532334530353733353f7374796c653d666c61742d737175617265)](CHANGELOG.md)[![PHP version](https://camo.githubusercontent.com/fe7bfc71c60d771f29e47b3129a8e7d2287d63ae875620de673a352dacd26e66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f657269636b736b72617563682f6d63632d6d6e632f7068703f7374796c653d666c61742d737175617265)](composer.json)[![Software License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Installation
------------

[](#installation)

To use this library, require it in [Composer](https://getcomposer.org):

```
composer require erickskrauch/mcc-mnc
```

Usage
-----

[](#usage)

```
$countryCode = \ErickSkrauch\MccMnc\Reference::countryFromMcc(260); // 'PL'
$mcc = \ErickSkrauch\MccMnc\Reference::mccFromCountry('US'); // 312
```

Contribute
----------

[](#contribute)

This library in an Open Source under the MIT license. It is, thus, maintained by collaborators and contributors.

Feel free to contribute in any way. As an example you may:

- Trying out the `master` code.
- Create issues if you find problems.
- Reply to other people's issues.
- Review PRs.

### Ensuring code quality

[](#ensuring-code-quality)

The project has several tools for quality control. All checks are performed in CI, but if you want to perform checks locally, here are the necessary commands:

```
composer normalize
vendor/bin/php-cs-fixer fix -v
vendor/bin/phpunit
```

###  Health Score

23

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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

Total

2

Last Release

1057d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab581fb1f2be61c3492ba1913ed418abe3cf64439589aeb7d6c68f854ad39e6e?d=identicon)[ErickSkrauch](/maintainers/ErickSkrauch)

---

Top Contributors

[![erickskrauch](https://avatars.githubusercontent.com/u/4787256?v=4)](https://github.com/erickskrauch "erickskrauch (8 commits)")

---

Tags

countriesISO 3166mccmncE212

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/erickskrauch-mcc-mnc/health.svg)

```
[![Health](https://phpackages.com/badges/erickskrauch-mcc-mnc/health.svg)](https://phpackages.com/packages/erickskrauch-mcc-mnc)
```

###  Alternatives

[league/iso3166

ISO 3166-1 PHP Library

69435.7M104](/packages/league-iso3166)[mledoze/countries

List of world countries in JSON, CSV, XML and YAML

6.2k689.8k6](/packages/mledoze-countries)[rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.

1.7k7.1M45](/packages/rinvex-countries)[stefangabos/world_countries

Constantly updated lists of world countries, territories and areas of geographical interest, with associated alpha-2, alpha-3 and numeric codes as defined by the ISO 3166-1 standard, available in multiple formats and languages, with national flags included

1.5k118.8k1](/packages/stefangabos-world-countries)[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M14](/packages/pragmarx-countries)[ip2location/ip2location-php

\[Official Release\] IP2Location PHP API to get location info from IPv4 and IPv6 address.

2223.8M30](/packages/ip2location-ip2location-php)

PHPackages © 2026

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