This package is used to validate the telephone numbers of the countries taken into account. It also makes it possible to verify that a number is indeed a number of an operator X

Overview

phone-number-checker

This package is used to validate the telephone numbers of the countries taken into account. It also makes it possible to verify that a number is indeed a number of an operator X

Installation

composer require faso-dev/phone-number-checker v0.1-beta

Use cases

/*
 * Copyright (c) 2021. | All Rights Reserved
 * @Author <FASO-DEV> [email protected]
 */


use FSDV\BF\Utils\Extractor\PhoneNumberExtractor;
use FSDV\BF\Utils\Extractor\PhoneNumberPrefixExtractor;
use FSDV\BF\Validator\PhoneNumber;

require_once __DIR__ . '/vendor/autoload.php';

//Vérifie si un numéro au format burkinabé est valide
PhoneNumber::validate('+22651000000'); //output: true
PhoneNumber::validate('0022651000000'); //output: true
PhoneNumber::validate('0022551000000'); //output: false
PhoneNumber::validate('51000000'); //output: true

//Vérifie l'opérateur mobile d'un numéro au format Burkinabé
//=======MOOV========
PhoneNumber::isMoov('+22651000000'); //output: true
PhoneNumber::isMoov('0022651000000'); //output: true
PhoneNumber::isMoov('0022654000000'); //output: false
//=======ORANGE========
PhoneNumber::isOrange('+22656000000'); //output: true
PhoneNumber::isOrange('0022656000000'); //output: true
PhoneNumber::isOrange('0022678000000'); //output: false
//=======TELECEL========
PhoneNumber::isTelecel('+22658000000'); //output: true
PhoneNumber::isTelecel('0022679000000'); //output: true
PhoneNumber::isTelecel('0022677000000'); //output: false

//Obtenir l'opérateur mobile d'un numéro de télephone
PhoneNumber::getOperator('+22651000000'); //output: MOOV BURKINA
PhoneNumber::getOperator('+22656000000'); //output: ORANGE BURKINA
PhoneNumber::getOperator('+22658000000'); //output: TELECEL BURKINA

//Obtenir les préfixes d'un opérateur mobile
PhoneNumber::getPhonePrefixes(PhoneNumber::MOOV_BURKINA); //output: ['01','02','51','52','53','60','61','62','63','70','71','72','73]
PhoneNumber::getPhonePrefixes(PhoneNumber::ORANGE_BURKINA); //output: ['06',07','54','55','56','57','64','65','66','67','74','75','76','77']
PhoneNumber::getPhonePrefixes(PhoneNumber::TELECEL_BURKINA); //output: ['58','59','68','69','78','79]

//Extraire le prefixe d'un numéro au format Burkinabé
PhoneNumberPrefixExtractor::extract('+22651000000'); //output: 51
PhoneNumberPrefixExtractor::extract('+22674000000'); //output: 74
PhoneNumberPrefixExtractor::extract('+22668000000'); //output: 68

//Extraire le numéro sans l'indicatif du pays
PhoneNumberExtractor::extract('+22651000000'); //output: 51000000
PhoneNumberExtractor::extract('+22674000000'); //output: 74000000
PhoneNumberExtractor::extract('+22668000000'); //output: 68000000
You might also like...
An all-in-one package with the minimum third-party requirements to get started as quickly as possible with Pokemod Atlas

Pokemod Atlas All-In-One An all-in-one package with the minimum third-party requirements to get started as quickly as possible with Pokemod Atlas. ❤️

Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways like sslcommerz, greenweb, dianahost,metronet in Laravel framework

Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways for Laravel. You should use

Simple PHP package for add two numbers

Sum Simple PHP package for add two numbers Installation To get the latest version of Sum, simply require the project using Composer: composer require

:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats.
:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats.

symfony upgrade fixer • twig gettext extractor • wisdom • centipede • permissions handler • extraload • gravatar • locurro • country list • transliter

World countries - available in multiple languages, in CSV, JSON, PHP, SQL and XML formats

Constantly updated lists of world countries and their associated alpha-2, alpha-3 and numeric country codes as defined by the ISO 3166 standard, available in CSV, JSON , PHP, SQL and XML formats, in multiple languages and with national flags included; also available are the ISO 3166-2 codes of provinces/ states associated with the countries

Execute time consuming tasks as late as possible in a request

Procrastinator for PHP: do stuff later A few classes to help you executing complicated tasks (like sending mails) later. Example using fastcgi_finish_

Deploying K3s to hetzner in the most ridiculous way possible: KISS

Deploying K3s to hetzner in the most ridiculous way possible: Keep it simply stupid. WTF is this? After experimenting with a few managed k8s installat

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.

Admidio Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it

Application with SQL Injection vulnerability and possible privilege escalation
Application with SQL Injection vulnerability and possible privilege escalation

Application with SQL Injection vulnerability and possible privilege escalation. Free vulnerable app for ethical hacking / penetration testing training.

Releases(v0.2-beta)
Owner
faso-dev
faso-dev
A tool that can be used to verify BC breaks between two versions of a PHP library.

Roave Backward Compatibility Check A tool that can be used to verify BC breaks between two versions of a PHP library. Pre-requisites/assumptions Your

Roave, LLC 530 Dec 27, 2022
This app is to measure the hand and eye co-ordination speed based on the score generated taken from Database

CoOrdinationSpeedTest Website link: https://skyward-punctures.000webhostapp.com/ Try this only when you are a psychiatrist ?? ?? This app runs as php

MANOJKUMAAR GOWDA 1 Jan 12, 2022
Système en php permettant d'obtenir des informations sur un numéro de téléphone.

?? Phone Checker ?? Système en php permettant d'obtenir des informations sur un numéro de téléphone. ?? • Prérequis : L'utilisation de ce système requ

SplidZ 5 Oct 31, 2022
This extensions makes it possible to modify the TCA of container children elements

This extensions makes it possible to modify the TCA of container children elements

Georg Ringer 6 Oct 24, 2022
Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Number to Bangla Number, Word or Month Name in Laravel | Get Wordpress Plugin Laravel package to convert English numbers to Bangla number or Bangla te

Md. Rakibul Islam 50 Dec 26, 2022
Traits used primarily in the v6 package but also available as a helper package for applications

Phalcon Traits This package contains traits with methods that are used for Phalcon v6 onward. It can also be useful to others that want short snippets

The Phalcon PHP Framework 5 Oct 7, 2022
Magento extension which makes it impossible for a customer to log in until the account has been activated by the administrator.

This Magento 1 extension is orphaned, unsupported and no longer maintained. If you use it, you are effectively adopting the code for your own project.

Vinai Kopp 120 Oct 10, 2022
The only way to implement the pipe operator in PHP.

Pipe Operator in PHP Introduction This package is based on the pipe operator RFC by Sara Golemon and Marcelo Camargo (2016), who explains the problem

BoostPHP 21 Nov 12, 2022
Verify purchase codes right on your WordPress dashboard.

envato-purchase-code-widget Verify purchase codes right on your WordPress dashboard. Install the plugin Go to Settings->EPCW and enter your "Envato AP

null 6 Oct 28, 2021
Helper for countries laravel package

Countries helper Helper for countries laravel package Installation You can install the package via composer: composer require eliseekn/countries-helpe

Kouadio Elisée N'GUESSAN 1 Oct 15, 2021