Skip to content

ProfiCloS/PhoneNumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub version travis-ci.com codecov.io

PhoneNumber validator & parser (CZ & SK & ...)

Install with composer

$ composer require proficlos/phonenumber

How to use

use ProfiCloS\Tools\PhoneNumber;

// validation
PhoneNumber::isPhone('+420777666555'); // true
PhoneNumber::isPhone('777666555'); // true
PhoneNumber::isPhone('77766655'); // false

// parser
$phone = PhoneNumber::from('+420777666555');

$phone->setFormat( PhoneNumber::FORMAT_INTERNATIONAL );
echo $phone; // 00420777666555

$phone->setFormat( PhoneNumber::FORMAT_GSM );
echo $phone; // +420777666555

$phone->setFormat( PhoneNumber::FORMAT_CANONICAL );
echo $phone; // +420 777 666 555

Buy us a coffee <3

Buy me a Coffee

Donate us <3

ETH: 0x7D771A56735500f76af15F589155BDC91613D4aB
UBIQ: 0xAC08C7B9F06EFb42a603d7222c359e0fF54e0a13

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages