PHPackages                             allan/msisdn - 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. allan/msisdn

ActiveLibrary

allan/msisdn
============

Msisdn number format, Prefixes are updated courtesy of https://en.wikipedia.org/wiki/Telephone\_numbers\_in\_Kenya

3173[1 issues](https://github.com/allan2012/msisdn/issues)PHP

Since Jan 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/allan2012/msisdn)[ Packagist](https://packagist.org/packages/allan/msisdn)[ RSS](/packages/allan-msisdn/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

msisdn
======

[](#msisdn)

This is a basic PHP 7 package that basically enforces the standard number format of 2547 prrefix of Kenyan based mobile numbers. The clean method also checks for the validity of an MSISDN number if given as 07XX, 7XX or 2547XX formats. Prefixes are updated courtesy of [https://en.wikipedia.org/wiki/Telephone\_numbers\_in\_Kenya](https://en.wikipedia.org/wiki/Telephone_numbers_in_Kenya)

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

[](#installation)

Download the package zip, extract and run

```
composer install

```

### Alternatively run:

[](#alternatively-run)

```
composer require allan/msisdn

```

Examples
--------

[](#examples)

### Get Channel

[](#get-channel)

```
use Msisdn\Utility;
include 'vendor/autoload.php';

var_dump(Utility::getMobileNetworkOperator("+254 720 000000")); // string(9) "Safaricom"
var_dump(Utility::getMobileNetworkOperator("0720000000")); // string(9) "Safaricom"
var_dump(Utility::getMobileNetworkOperator("720000000")); // string(9) "Safaricom"
```

### Clean MSISDN

[](#clean-msisdn)

```
use Msisdn\Utility;
include 'vendor/autoload.php';

var_dump(Utility::clean("+254 720 000000")); // int(254720000000)
var_dump(Utility::clean("0720000000")); // int(254720000000)
var_dump(Utility::clean("720000000")); // int(254720000000)
var_dump(Utility::clean("7200022")); // int(-1) invalid MSISDN format that cannot be sanitized
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![allan2012](https://avatars.githubusercontent.com/u/3263804?v=4)](https://github.com/allan2012 "allan2012 (10 commits)")

### Embed Badge

![Health badge](/badges/allan-msisdn/health.svg)

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

PHPackages © 2026

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