PHPackages                             waughj/us-phone-number - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. waughj/us-phone-number

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

waughj/us-phone-number
======================

Class for easily reformatting a US phone number.

v0.1.0(6y ago)022AGPL-3.0-or-laterPHPPHP &gt;=7.2

Since Sep 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/waughjai/us-phone-number)[ Packagist](https://packagist.org/packages/waughj/us-phone-number)[ RSS](/packages/waughj-us-phone-number/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

US Phone Number
===============

[](#us-phone-number)

Class for easily reformatting a US phone number.

Constructor takes in 1 argument, which can either be a string with at least 10 numbers, an array with at least 3 items, or another instance of USPhoneNumber class. Any inputs that violate these rules or which lead to parts of a phone number with the wrong number of digits will throw an InvalidPhoneNumberException.

Example
-------

[](#example)

```
use WaughJ\USPhoneNumber\USPhoneNumber;

$phone_number = new USPhoneNumber( '2565552028' );
echo $phone_number->getFormat( '(a) p – l' );

```

Will print:

```
(256) 555 — 2028

```

Changelog
---------

[](#changelog)

### 0.1.0

[](#010)

- Initial Release

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2470d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11161078?v=4)[waughj](/maintainers/waughj)[@waughj](https://github.com/waughj)

---

Tags

formattingphone-number

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waughj-us-phone-number/health.svg)

```
[![Health](https://phpackages.com/badges/waughj-us-phone-number/health.svg)](https://phpackages.com/packages/waughj-us-phone-number)
```

###  Alternatives

[brick/phonenumber

Phone number library

4267.5M57](/packages/brick-phonenumber)[odolbeau/phone-number-bundle

Integrates libphonenumber into your Symfony application

24810.9M16](/packages/odolbeau-phone-number-bundle)[log1x/acf-phone-number

A real ACF phone number field.

11975.2k](/packages/log1x-acf-phone-number)[flarum/markdown

Allow posts to be formatted with Markdown.

18431.8k18](/packages/flarum-markdown)[flarum/emoji

Convert text and unicode emoji into Twemoji.

17404.2k4](/packages/flarum-emoji)[mnapoli/pretty

Run all code formatting tools with one command: pretty

1085.1k9](/packages/mnapoli-pretty)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
