定制 damien-louis/libphonenumber-shortcuts 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

damien-louis/libphonenumber-shortcuts

最新稳定版本:0.1.1

Composer 安装命令:

composer require damien-louis/libphonenumber-shortcuts

包简介

Shortcuts to use libphonenumber quickly and easily

README 文档

README

Provide shortcuts to use famous libphonenumber functions most quickly and easily.
Exceptions are voluntarily catched because the goal is to use this only in final context (displaying for example).

Installation

composer req damien-louis/libphonenumber-shortcuts

Format

Return string or null If something is invalid (bad number, unknown format or region), result is null

//06 05 04 03 02
$result = \PhoneNumberShortcuts::format('+33605040302', PhoneNumberShortcuts::NATIONAL);

//+33 6 05 04 03 02
$result = \PhoneNumberShortcuts::format('0605040302', PhoneNumberShortcuts::INTERNATIONAL, 'FR');

Validation

Return boolean

//true
$isValid = \PhoneNumberShortcuts::isValid('+33 607080910');

//true
$isValid = \PhoneNumberShortcuts::isValid('+33 607080910', 'FR');

//false
$isValid = \PhoneNumberShortcuts::isValid('+1607080910', 'FR');

Region Code

Return string or null

//GB
$result = \PhoneNumberShortcuts::getRegionCodeForNumber('+44 117 496 0123');

//FR
$result = \PhoneNumberShortcuts::getRegionCodeForNumber('+33 1 02 03 04 05');

//US
$result = \PhoneNumberShortcuts::getRegionCodeForNumber('+12135096995');

//null
$result = \PhoneNumberShortcuts::getRegionCodeForNumber('notanumber');

统计信息

  • 总下载量: 847
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固