alphaolomi/tz-phone-number
最新稳定版本:v1.0.0-beta
Composer 安装命令:
composer require alphaolomi/tz-phone-number
包简介
This is my package tz-phone-number
README 文档
README
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 456or754 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
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-24