giggsey/libphonenumber-for-php — dự án backend — đang có 5.1k sao GitHub trong nhóm Backend. PHP version of Google's phone number handling library
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/giggsey/libphonenumber-for-php là nguồn chính thức.
giggsey/libphonenumber-for-php có bao nhiêu sao?
giggsey/libphonenumber-for-php có 5.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/giggsey/libphonenumber-for-php. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
giggsey/libphonenumber-for-php có những chủ đề gì?
GitHub topics của giggsey/libphonenumber-for-php: "hacktoberfest", "libphonenumber", "phone-number", "php". TopGit xếp repo vào nhóm Backend.
giggsey/libphonenumber-for-php có trang demo không?
Dự án có trang chủ ở https://giggsey.com/libphonenumber/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
giggsey/libphonenumber-for-php còn đang phát triển không?
Commit gần nhất trên giggsey/libphonenumber-for-php là 4 tháng trước (theo timestamp GitHub). Repo có 478 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
giggsey/libphonenumber-for-php dùng license gì?
giggsey/libphonenumber-for-php phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
giggsey/libphonenumber-for-php viết bằng ngôn ngữ gì?
giggsey/libphonenumber-for-php chủ yếu viết bằng PHP. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc libphonenumber-for-php có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về libphonenumber-for-php.