定制 alwaysblank/rotary 二次开发

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

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

alwaysblank/rotary

最新稳定版本:2.1.0

Composer 安装命令:

composer require alwaysblank/rotary

包简介

Handle phone numbers.

README 文档

README

Simplify working with phone numbers.

Build Status

Warning ⚠

Rotary will support numbers that look like the standard number format used in the United State of America, i.e. nnn-nnnn or nnn nnn-nnnn. These can also be prepended with an international country code up to 5 digit long, i.e. nn nnn nnn-nnnn. Numbers that deviate from this pattern cannot be reliably interpreted.

Usage 💪

Although all the internal behaviors are easily accessible (with the exception of the Number class, all methods are available as static methods), in general, you'll just be using these methods from the Render class:

  • pretty will result in (123) 456-7890 or 456-7890.
  • simple will result in 123 456-7890 or 456-7890.
  • href will result in tel:+11234567890 or tel:+14567890.
  • normalized will result in 1234567890 or 567890.

You can call them like this:

use AlwaysBlank\Rotary\Render;

echo Render::pretty('1234567890');
// (123) 456-7890

echo Render::pretty('123 456 7890');
// (123) 456-7890

echo Render::pretty('[123)    456/7890');
// (123) 456-7890

You can also instantiate a Rotary object, which has methods for the different format types:

use AlwaysBlank\Rotary\Rotary;

$Rotary = new Rotary('123456789');
echo $Rotary->pretty();
// (123) 456-7890

This can be useful if you want access to several formats on one number.

You can put any non-digit characters you like in your argument and Rotary will simply ignore them--it cares only for digits. 234-5678 and 2dfsad__34-5)(6=78 are identical so far as it's concerned.

Note: Rotary will try to interpret strange arguments, but it has limits, so please try to pass it numbers that make sense. 🙏

统计信息

  • 总下载量: 1.53k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固