giggsey/libphonenumber-for-php is one of the server-side repositories TopGit tracks, currently at 5.0k stars, written primarily in PHP. PHP version of Google's phone number handling library
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
A PHP library for parsing, formatting, storing and validating international phone numbers. This library is based on Google's libphonenumber.
Installation
Documentation
Online Demo
Versioning
Quick Examples
Geocoder
ShortNumberInfo
Mapping Phone Numbers to Carrier
Mapping Phone Numbers to TimeZones
FAQ
Problems with Invalid Numbers?
Generating data
Integration with frameworks
Installation
PHP versions 8.1 to 8.5 are currently supported.
The PECL mbstring extension is required.
It is recommended to use composer to install the library.
composer require giggsey/libphonenumber-for-php
You can also use any other PSR-4 compliant autoloader.
If you do not use composer, ensure that you also load any dependencies that this project has, such as giggsey/locale.
giggsey/libphonenumber-for-php-lite
If you only want to make use of the core PhoneNumber Util functionality, you can use giggsey/libphonenumber-for-php-lite, which offers a much smaller package size.
PHP Version Policy
This library will be updated to use supported versions of PHP without major version bumps.
Documentation
PhoneNumber Util
ShortNumber Info
Phone Number Geolocation
Phone Number to Carrier Mapping
Phone Number to Timezone Mapping
Phone Number Matcher
As You Type Formatter
Online Demo
An online demo is available, and the source can be found at giggsey/libphonenumber-example.
Versioning
This library will try to follow the same version numbers as Google. There could be additional releases where needed to fix critical issues that can not wait until the next release from Google.
This does mean that this project may not follow Semantic Versioning, but instead Google's version policy. As a result, jumps in major versions may not actually contain any backwards
incompatible changes. Please read the release notes for such releases.
Google try to release their versions according to Semantic Versioning, as laid out of in their Versioning Guide.
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:
You could also choose to format the number in the way it is dialled from another country:
// Produces "011 41 44 668 1800", the number when it is dialled in the United States.
echo $phoneUtil->formatOutOfCountryCallingNumber($swissNumberProto, "US");
// Produces "00 41 44 668 18 00", the number when it is dialled in Great Britain.
echo $phoneUtil->formatOutOfCountryCallingNumber($swissNumberProto, "GB");
This library uses phone number metadata from Google's libphonenumber. If this library is working as intended, it should provide the same result as the Java version of Google's project.
If you believe that a phone number is returning an incorrect result, first test it with libphonenumber via their Online Demo. If that returns the same result as this project, and you feel it is in error, raise it as an Issue with the libphonenumber project.
If Google's Online Demo gives a different result to the libphonenumber-for-php demo, then please raise an Issue here.
Generating data
Generating the data is not normally needed, as this repository will generally always have the up to date metadata.
To compile the data, run the composer script 'build'
composer run build
This build process clones the libphonenumber project at the version specified in METADATA-VERSION.php.
Integration with frameworks
Other packages exist that integrate libphonenumber-for-php into frameworks.
Framework
Packages
Symfony
PhoneNumberBundle
Laravel
Laravel Phone
TYPO3
TYPO3 Phone Extension
These packages are supplied by third parties, and their quality can not be guaranteed.
How active is development on giggsey/libphonenumber-for-php?
The most recent commit recorded on giggsey/libphonenumber-for-php was 1 month ago, based on the GitHub push timestamp. The repository has 480 forks — one of the better signals of community interest.
How many stars does giggsey/libphonenumber-for-php have?
giggsey/libphonenumber-for-php has 5.0k GitHub stars — refresh the page for the live number, or check github.com/giggsey/libphonenumber-for-php. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is giggsey/libphonenumber-for-php written in?
giggsey/libphonenumber-for-php is written primarily in PHP. GitHub's language field is based on the largest share of bytes in the default branch.
What license does giggsey/libphonenumber-for-php use?
giggsey/libphonenumber-for-php is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
What topics is giggsey/libphonenumber-for-php associated with?
GitHub's repository topics for giggsey/libphonenumber-for-php: "hacktoberfest", "libphonenumber", "phone-number", "php". TopGit's editorial category is Backend.
Where can I see giggsey/libphonenumber-for-php in action?
The project maintains a homepage at https://giggsey.com/libphonenumber/. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about giggsey/libphonenumber-for-php?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/giggsey/libphonenumber-for-php is the definitive source.
Read full README in the tab above.
Still deciding about libphonenumber-for-php?
One click hands the question to an AI along with this page — see what it says about libphonenumber-for-php.