leadsolution/phone-number-normalizer
Composer 安装命令:
composer require leadsolution/phone-number-normalizer
包简介
Normalizes Brazilian Phone Numbers.
README 文档
README
📞 It tries to normalize a phone number from whatever * input it receives.
*(can't do magic, if you got a new case, feel free to open an issue or a PR).
Install
composer require leadsolution/phone-number-normalizer
Usage examples
use Leadsolution\PhoneNumber\Normalizer; $normalizer = new Normalizer();
Removes non-digits
$normalizer->normalize('2345-6789')->toString(); // 23456789 $normalizer->normalize('(11) 2345-6789')->toString(); // 1123456789
Adds default national codes
$normalizer->normalize('2345-6789', '11')->toString(); // 1123456789
Removes international codes
$normalizer->normalize('+55 (11) 2345-6789')->toString(); // 1123456789
Adds the 9 digit on mobile numbers
$normalizer->normalize('7345-6789', '11')->toString(); // 11973456789
Checks if the returned object is a mobile
$normalizer->normalize('987654321')->isMobile(); // true $normalizer->normalize('23456789')->isMobile(); // false
MIT
统计信息
- 总下载量: 169
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-09