承接 alphaolomi/tz-phone-number 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

alphaolomi/tz-phone-number

最新稳定版本:v1.0.0-beta

Composer 安装命令:

composer require alphaolomi/tz-phone-number

包简介

This is my package tz-phone-number

README 文档

README

Latest Version on Packagist Tests Total Downloads

A PHP package to validate and format Tanzanian phone numbers. It uses the Tanzania Communications Regulatory Authority Schema to reconcile and validate the phone number and get the network operator.

Installation

You can install the package via composer:

composer require alphaolomi/tz-phone-number

Usage

use Alphaolomi\TzPhoneNumber\PhoneNumber;

$phoneNumber = new PhoneNumber('255 754 123 456');


// To get the country code
$phoneNumber->getCountryCode(); // 255

// To get the Network Operator
$phoneNumber->getNetworkOperator(); // Vodacom

// To check if the phone number is valid
$phoneNumber->isValid(); // true

// To get the phone number in international format
$phoneNumber->getNumber(); // +255754123456

// To get the phone number in local format
$phoneNumber->getLocalNumber(); // -754123456

Caveats

  • The phone number must be in the format 255 754 123 456 or 754 123 456

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Reference

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-24