nigel / phone_lib
Implementation of jenesiszw/phone_lib
dev-master
2024-02-19 10:32 UTC
Requires
- jenesiszw/phone_lib: dev-master
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
- isValid()
- check if number is valid or not
- internationalFormat()
- get international format from the parsed number
- nationalFormat()
- get national format from the parsed number
- getCountry()
- get country name from the parsed number
- providerInfo()
- get provider info from the parsed number
- timeZoneInfo()
- get timezone info from the parsed number