emleons/tz_namba 问题修复 & 功能扩展

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

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

emleons/tz_namba

最新稳定版本:v1.0.1

Composer 安装命令:

composer require emleons/tz_namba

包简介

Simple php class to validate Tanzania phone numbers by cheking if it is well formated

README 文档

README

This is a simple PHP library for validating Tanzania phone numbers. It uses check if a given phone number is well formated. by default it accepts the following formats: +255956413291 255696413291 0656913291 you can modify it per your needs by editing the file from src/ValidateNamba.php

Installation

To use this library, you need to have Composer installed in your system. Once you have Composer installed, you can download the library by running the following command:

composer require emleons/tz_namba

Usage

Here is an example of how to use it:

require('vendor/autoload.php');
use Emleons\TzNamba\ValidateNamba;

$test = new ValidateNamba;
$phone = "+255752123456"; // Replace with the phone number you want to validate

if($test->validate($phone)){
    echo $phone." is a valid phone".'<br>';
}else{
    echo $phone." is an invalid phone".'<br>';
}
//sometimes you may want to remove prefix from phone numbers to do it use the remove_tz_prefix() method and pass your phone that follows accepted format
$removed_prefix = $test->remove_tz_prefix($phone);
echo "Removed prefix from ".$phone." to ".$removed_prefix;

Contributions

If you find a bug or have a feature request, please open an issue or submit a pull request.

Credits

Developed by Emleons email:emleons23@gmail.com

统计信息

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

GitHub 信息

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

其他信息

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