定制 haroldkerry/msisdn-network-detector 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

haroldkerry/msisdn-network-detector

最新稳定版本:v3.0.0

Composer 安装命令:

composer require haroldkerry/msisdn-network-detector

包简介

Detects mobile network providers for given MSISDNs

README 文档

README

A PHP library for cleaning MSISDNs and detecting mobile network providers based on number prefixes.

Supported Kenyan Networks

  • Safaricom
  • Airtel
  • Telkom
  • Equitel

Non-Kenyan numbers are automatically classified a International

Installation

You can install via Composer:

composer require haroldkerry/msisdn-network-detector

Usage Example

use HaroldKerry\MsisdnNetworkDetector\NetworkDetector;

$detector = new NetworkDetector();

/**
 * Detect Network (Recommended)
 */



$network = $detector->detectNetwork('+254700000000');
echo "Network: " . $network; 
// Safaricom, Airtel, Telkom, Equitel, // Unknown Kenyan Network, or International

/**
 * Clean an MSISDN
 */

$cleaned = $detector->cleanMsisdn('+254 700 000 000');
echo $cleaned; // 0700000000 (for Kenyan numbers) // 255700000000 (for international numbers)

/**
 * Detect Multiple MSISDNs
 */
$msisdns = [ '+254700000000', '0735110000', '+255700000000' ];
$results = $detector->detectMultipleNetworks($msisdns);

print_r($results); // [ '+254700000000' => 'Safaricom', '0735110000' => 'Airtel', '+255700000000' => 'International' ]

Kenyan Number Rules

A number is treated as Kenyan if it starts with:

+254 254 or 0

Valid Kenyan numbers are normalized to:

07XXXXXXXX

If the prefix does not match any known network, the result will be:

Unknown Kenyan Network

International Numbers

Any number that does not match Kenyan formats will:

Be cleaned (digits only)

Be returned as International during detection

Contributing

Contributions are welcome via Pull Requests. Please fork the repository and submit a PR to the main branch.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固