malico/mobile-cm-php

获取电话号码的移动网络

1.3.1 2021-09-07 11:43 UTC

This package is auto-updated.

Last update: 2024-09-12 17:25:36 UTC


README

根据用户号码确定移动电话运营商(喀麦隆)

安装

composer require malico/mobile-cm-php

使用方法

<?php

require 'vendor/autoload.php';

use Malico\MobileCM\Network;

$phone = '00237653956703';
// $phone = '+237653956703';
// $phone = '237653956703';
// $phone = '653956703';

echo Network::check($phone);
// nexttel | mtn | orange | camtel

if (Network::isOrange($phone)) {
    echo 'Orange';
}
if (Network::IsNexttel($phone)) {
    echo 'Nextel';
}

if (Network::isCamtel($phone)) {
    echo 'Camtel';
}


?>

简单。但有用

* Camtel numbers are tricky. Not sure. Feel feel free to send in a PR for that.