gabeta/gsm-detector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

gabeta/gsm-detector

Composer 安装命令:

composer require gabeta/gsm-detector

包简介

Detect a GSM form phone number

README 文档

README

Build Status

A propos

Gsm Detector is a PHP package which allows to know the name of the GSM network of a given phone number.

Installation

Compatible with PHP >= 5.4

composer require gabeta/gsm-detector

How it works

You must initiate the GsmDetector class with an array containing the names of GSM networks and their different prefixes.

Code d'exmple:

use Gabeta\GsmDetector\GsmDetector;

$gsmDetector = new GsmDetector([
    'orange' => [
        'fix' => ['22', '35'],
        'mobile' => ['09', '88']
    ],
    'mtn' => [
        'fix' => ['23', '24'],
        'mobile' => ['04', '05']
    ],
]);

Here we instantiate our class with the GSM mtn and orange networks and their different prefixes. Each GSM network defined in our table must have the "fix" and / or "mobile" keys to define our various prefixes.

use Gabeta\GsmDetector\GsmDetector;

$gsmDetector = new GsmDetector([
    'orange' => [
        'fix' => ['22', '35'],
        'mobile' => ['09', '88']
    ],
    'mtn' => [
        'fix' => ['23', '24'],
        'mobile' => ['04', '05']
    ],
]);

$gsmDetector->isMtn('04000000') // true

$gsmDetector->isMtn('24000000') // true
        
$gsmDetector->isMtn('35000000') // false
        
$gsmDetector->isMtn('08000000') // false

$gsmDetector->isMtn('23000000') // true

$gsmDetector->isOrange('88000000') // true

$gsmDetector->isOrange('09000000') // true

$gsmDetector->isOrange('22000000') // true

$gsmDetector->isMtnFix('23000000') // true

$gsmDetector->isMtnFix('24000000') // true

$gsmDetector->isMtnFix('04000000') // false

$gsmDetector->isMtnMobile('04000000') // true

$gsmDetector->isOrangeFix('22000000') // true

$gsmDetector->isOrangeFix('35000000') // true

$gsmDetector->isOrangeMobile('35000000') // false

/**
* OTHERS METHODS
**/

$gsmDetector->getGsmName('04000000'); // mtn

$gsmDetector->isMobile('04000000'); // true

$gsmDetector->isFix('04000000'); // false

For each new name of GSM defines three methods are created:

  • is{Gsm}
  • is{Gsm}Fix
  • is{Gsm}Mobile

For moov for example we will therefore have:

  • isMoov
  • isMoovFix
  • isMoovMobile

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固