nigel/phone_lib

Implementation of jenesiszw/phone_lib

dev-master 2024-02-19 10:32 UTC

This package is auto-updated.

Last update: 2024-12-19 12:24:38 UTC


README

a classic phone number library.

Get Started

Installtion

 composer require nigel/phone_lib:dev-master jenesiszw/phone_lib:dev-master

Import vendor folder and PhoneLibrary class

<?php

use JenesisZw\Phone;

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

Usage

$phone = "0782000340"; // Zimbabwe Econet Number

$test = (new Phone($phone, 'ZW'))->internationalFormat();


function dd($data)
{
    echo "<code>";
    echo "<pre>";
    die(print_r($data, true));
    echo "</pre>";
    echo "</code>";
}


dd($test);

Response


263782000340

Available Methods

  1. isValid()
  • check if number is valid or not
  1. internationalFormat()
  • get international format from the parsed number
  1. nationalFormat()
  • get national format from the parsed number
  1. getCountry()
  • get country name from the parsed number
  1. providerInfo()
  • get provider info from the parsed number
  1. timeZoneInfo()
  • get timezone info from the parsed number