PHPackages                             practo/libphonenumber-for-php - 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. practo/libphonenumber-for-php

Abandoned → [giggsey/libphonenumber-for-php](/?search=giggsey%2Flibphonenumber-for-php)Library[Validation &amp; Sanitization](/categories/validation)

practo/libphonenumber-for-php
=============================

Clone of Phone number handling library by Davide Mendolia

5.8.8(12y ago)2029.6k7[2 issues](https://github.com/practo/libphonenumber-for-php/issues)Apache-2.0PHP

Since Sep 22Pushed 12y ago34 watchersCompare

[ Source](https://github.com/practo/libphonenumber-for-php)[ Packagist](https://packagist.org/packages/practo/libphonenumber-for-php)[ Docs](https://github.com/practo/libphonenumber-for-php)[ RSS](/packages/practo-libphonenumber-for-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

Project not maintained anymore. See
---------------------------------------------------------------------------------------

[](#project-not-maintained-anymore-see-httpsgithubcomgiggseylibphonenumber-for-php)

[![Travis Build](https://camo.githubusercontent.com/c854d60f51ad1e2eb29211f2dcdcb5f647487b042966c3801ac61cea9aa3415e/68747470733a2f2f7472617669732d63692e6f72672f70726163746f2f6c696270686f6e656e756d6265722d666f722d7068702e706e67)](https://travis-ci.org/practo/libphonenumber-for-php)

What is it?
===========

[](#what-is-it)

PHP library for parsing, formatting, storing and validating international phone numbers.

Highlights of functionality
===========================

[](#highlights-of-functionality)

- Parsing/formatting/validating phone numbers for all countries/regions of the world.
- getNumberType - gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP and Personal Numbers (whenever feasible).
- isNumberMatch - gets a confidence level on whether two numbers could be the same.
- getExampleNumber/getExampleNumberByType - provides valid example numbers for all countries/regions, with the option of specifying which type of example phone number is needed.
- isValidNumber - full validation of a phone number for a region using length and prefix information.

Quick Examples
==============

[](#quick-examples)

Let's say you have a string representing a phone number from Switzerland. This is how you parse/normalize it into a PhoneNumber object:

```
$swissNumberStr = "044 668 18 00";
$phoneUtil = PhoneNumberUtil::getInstance();
try {
	$swissNumberProto = $phoneUtil->parse($swissNumberStr, "CH");
	var_dump($swissNumberProto);
} catch (NumberParseException $e) {
	echo $e;
}

```

At this point, swissNumberProto contains:

```
object(libphonenumber\PhoneNumber)#221 (5) {
  ["countryCode":"libphonenumber\PhoneNumber":private]=>
  int(41)
  ["nationalNumber":"libphonenumber\PhoneNumber":private]=>
  int(446681800)
  ["extension":"libphonenumber\PhoneNumber":private]=>
  NULL
  ["italianLeadingZero":"libphonenumber\PhoneNumber":private]=>
  NULL
  ["rawInput":"libphonenumber\PhoneNumber":private]=>
  NULL
}

```

Now let us validate whether the number is valid:

```
$isValid = $phoneUtil->isValidNumber($swissNumberProto);//return true
var_dump($isValid);

```

There are a few formats supported by the formatting method, as illustrated below:

```
// Produces "+41446681800"
echo $phoneUtil->format($swissNumberProto, PhoneNumberFormat::E164) . PHP_EOL;

```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 59.6% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4573d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4995b3d52b3d8a57f35d85ceeeb03e0f3f500ab38ecf5ca7a1fe89f606a21991?d=identicon)[justjkk](/maintainers/justjkk)

---

Top Contributors

[![davideme](https://avatars.githubusercontent.com/u/858090?v=4)](https://github.com/davideme "davideme (81 commits)")[![justjkk](https://avatars.githubusercontent.com/u/192893?v=4)](https://github.com/justjkk "justjkk (30 commits)")[![ajayrungta](https://avatars.githubusercontent.com/u/394210?v=4)](https://github.com/ajayrungta "ajayrungta (22 commits)")[![abhinavlal](https://avatars.githubusercontent.com/u/445119?v=4)](https://github.com/abhinavlal "abhinavlal (3 commits)")

---

Tags

validationlibphonenumbermobilephonenumber

### Embed Badge

![Health badge](/badges/practo-libphonenumber-for-php/health.svg)

```
[![Health](https://phpackages.com/badges/practo-libphonenumber-for-php/health.svg)](https://phpackages.com/packages/practo-libphonenumber-for-php)
```

###  Alternatives

[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k148.7M414](/packages/giggsey-libphonenumber-for-php)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M106](/packages/propaganistas-laravel-phone)[giggsey/libphonenumber-for-php-lite

A lite version of giggsey/libphonenumber-for-php, which is a PHP Port of Google's libphonenumber

8412.9M47](/packages/giggsey-libphonenumber-for-php-lite)[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k489.6M671](/packages/composer-semver)[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M381](/packages/respect-validation)[opis/json-schema

Json Schema Validator for PHP

64236.9M185](/packages/opis-json-schema)

PHPackages © 2026

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