Download the PHP package khakimjanovich/uz-phone without Composer
On this page you can find all versions of the php package khakimjanovich/uz-phone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download khakimjanovich/uz-phone
More information about khakimjanovich/uz-phone
Files in khakimjanovich/uz-phone
Package uz-phone
Short Description Framework-agnostic PHP library for strict Uzbek mobile phone parsing, normalization, validation, formatting, masking, and prefix metadata.
License MIT
Homepage https://github.com/khakimjanovich/uz-phone
Informations about the package uz-phone
uz-phone
Strict Uzbek phone parsing for PHP. UzPhoneNumber wraps brick/phonenumber
internally, adds Uzbekistan prefix data, and exposes a small Brick-style
object API without leaking Brick classes.
Why
Most apps only need one thing from Uzbek phone input: parse it into a canonical
object, identify its prefix type, and then decide what their own domain should
accept. uz-phone keeps that surface small, strict, and framework-agnostic.
- Parses Uzbek phone numbers
- Normalizes to E.164:
+998901234567 - Formats display output:
+998 90 123 45 67 - Masks private output:
+998 90 *** ** 67 - Returns prefix data with PHP backed enums
- Uses
brick/phonenumberfor phone-number parsing and formatting - Keeps Uzbek prefix type and operator data in this package
Installation
Requires PHP 8.2 or newer.
Usage
Prefix Data
Prefix data reflects original numbering allocation, not a guaranteed
current operator or location after number portability. Geographic PSTN prefixes
return null from getOperator() because the ITU table names the region, not
a specific operator.
Supported Input
All accepted input normalizes to +998901234567.
The parser is intentionally strict. It accepts digits, a leading +, spaces,
parentheses, and hyphens. It rejects unknown prefixes, wrong country codes,
unsupported separators, letters, overlong numbers, and incomplete numbers.
Uzbek Prefixes
Source: ITU Uzbekistan numbering plan update.
| Prefix | Type | Operator |
|---|---|---|
| 20 | MOBILE_GSM |
OQ_BEELINE |
| 33 | MOBILE_GSM |
HUMANS |
| 36 | FIXED_NETWORK_SERVICE_PROVIDER |
BUZTON |
| 50 | MOBILE_GSM |
UCELL_COSCOM |
| 55 | SIP |
UZTELECOM |
| 61 | GEOGRAPHIC_PSTN |
|
| 62 | GEOGRAPHIC_PSTN |
|
| 65 | GEOGRAPHIC_PSTN |
|
| 66 | GEOGRAPHIC_PSTN |
|
| 67 | GEOGRAPHIC_PSTN |
|
| 69 | GEOGRAPHIC_PSTN |
|
| 70 | GEOGRAPHIC_PSTN |
|
| 71 | GEOGRAPHIC_PSTN |
|
| 72 | GEOGRAPHIC_PSTN |
|
| 73 | GEOGRAPHIC_PSTN |
|
| 74 | GEOGRAPHIC_PSTN |
|
| 75 | GEOGRAPHIC_PSTN |
|
| 76 | GEOGRAPHIC_PSTN |
|
| 77 | MOBILE_GSM |
UZMOBILE_GSM |
| 78 | FIXED_NETWORK_SERVICE_PROVIDER |
|
| 79 | GEOGRAPHIC_PSTN |
|
| 80 | MOBILE_GSM |
PERFECTUM_MOBILE |
| 87 | MOBILE_GSM |
MOBIUZ_UMS |
| 88 | MOBILE_GSM |
MOBIUZ_UMS |
| 90 | MOBILE_GSM |
BEELINE_UNITEL |
| 91 | MOBILE_GSM |
BEELINE_UNITEL |
| 92 | MOBILE_GSM |
BEELINE_UNITEL |
| 93 | MOBILE_GSM |
UCELL_COSCOM |
| 94 | MOBILE_GSM |
UCELL_COSCOM |
| 95 | MOBILE_CDMA_GSM |
UZMOBILE_CDMA |
| 97 | MOBILE_GSM |
MOBIUZ_UMS |
| 98 | MOBILE_CDMA |
PERFECTUM_MOBILE |
| 99 | MOBILE_GSM |
API
parse() throws ParseException when the input is not a valid
Uzbek phone number. The exception exposes ParseErrorType through
$exception->error_type.
UzPhoneNumber methods:
Parse error types:
Testing
License
MIT.