proficlos / 电话号码
捷克电话号码验证器与解析器
v1.0.1
2018-10-02 14:07 UTC
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-09-29 04:14:39 UTC
README
电话号码验证器与解析器 (CZ & SK & ...)
使用composer安装
$ composer require proficlos/phonenumber
如何使用
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
给我们买杯咖啡 <3
向我们捐赠 <3
ETH: 0x7D771A56735500f76af15F589155BDC91613D4aB
UBIQ: 0xAC08C7B9F06EFb42a603d7222c359e0fF54e0a13