PHPackages                             libtelex/telex-2 - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. libtelex/telex-2

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

libtelex/telex-2
================

Telephone numbers matched, validated, formatted, using PHP

0406↓87.5%PHP

Since Apr 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/libtelex/telex-2)[ Packagist](https://packagist.org/packages/libtelex/telex-2)[ RSS](/packages/libtelex-telex-2/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

TELEX-2
=======

[](#telex-2)

Telephone numbers matched, validated, formatted, using [PHP](https://www.php.net/).

Warning

TELEX-2 is a work in progress and does not yet offer the same functionality as its earlier incarnation, [Telex](https://github.com/libtelex/telex)

Warning

Only a small selection of European countries is supported at present—find out which ones by looking in `src/RuleSet`—and the rule-sets that *have* been implemented may not correctly recognise all of the country's numbers.

TELEX-2 is used by [SeeTheWorld](https://www.seetheworld.com/).

Usage
-----

[](#usage)

Quickly format a telephone number:

```
echo (new Telex2())->formatIntl('+44 (0)785 056 6978');  // => `"+44 7850 566978"`
```

Or get a complete rundown:

```
$telex2 = new Telex2();
print_r($telex2->match('+44 (0)785 056 6978'));

/*
=> Libtelex\Telex2\TelephoneNumber Object
(
    [source:Libtelex\Telex2\TelephoneNumber:private] => +44 (0)785 056 6978
    [countryCallingCode:Libtelex\Telex2\TelephoneNumber:private] => 44
    [isoAlpha2CountryCode:Libtelex\Telex2\TelephoneNumber:private] => GB
    [nationalNumber:Libtelex\Telex2\TelephoneNumber:private] => 07850566978
    [type:Libtelex\Telex2\TelephoneNumber:private] => 2
    [formatted:Libtelex\Telex2\TelephoneNumber:private] => +44 7850 566978
)
*/
```

Installation
------------

[](#installation)

Install using [Composer](https://getcomposer.org/):

```
composer require libtelex/telex-2
```

Background
----------

[](#background)

TELEX-2 is yet another attempt at recognising, and formatting, telephone numbers using PHP; it is an evolution of [Telex](https://github.com/libtelex/telex), which does a slightly better job than some much older, messier code.

TELEX-2 more reliably matches telephone numbers because it looks for more country-specific, numeric 'signatures'. These signatures, patterns in a country's [telephone numbering plan](https://en.wikipedia.org/wiki/Telephone_numbering_plan), are encoded in separate rule-set classes—one for each country.

It's all still pretty rudimentary, really, but this latest incarnation is more robust and reliable, and its approach is much more satisfying than Telex'.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb4422c02b29b1ae4a4746abb1ebf16c0216d5fc62cf0604e7c6aa4de974b39b?d=identicon)[danbettles](/maintainers/danbettles)

---

Top Contributors

[![danbettles](https://avatars.githubusercontent.com/u/736672?v=4)](https://github.com/danbettles "danbettles (1 commits)")

### Embed Badge

![Health badge](/badges/libtelex-telex-2/health.svg)

```
[![Health](https://phpackages.com/badges/libtelex-telex-2/health.svg)](https://phpackages.com/packages/libtelex-telex-2)
```

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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