PHPackages                             khakimjanovich/uz-phone - 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. khakimjanovich/uz-phone

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

khakimjanovich/uz-phone
=======================

Framework-agnostic PHP library for strict Uzbek mobile phone parsing, normalization, validation, formatting, masking, and prefix metadata.

v1.2.0(1mo ago)40MITPHPPHP ^8.2CI passing

Since May 6Pushed 1mo agoCompare

[ Source](https://github.com/khakimjanovich/uz-phone)[ Packagist](https://packagist.org/packages/khakimjanovich/uz-phone)[ Docs](https://github.com/khakimjanovich/uz-phone)[ RSS](/packages/khakimjanovich-uz-phone/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

uz-phone
========

[](#uz-phone)

[![Latest Version](https://camo.githubusercontent.com/1dc42b588d5568243f2ffcc38a377117c70422335d0a6f5925940fb3c4ed35e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b68616b696d6a616e6f766963682f757a2d70686f6e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/khakimjanovich/uz-phone)[![PHP Version](https://camo.githubusercontent.com/3eb6864be7ffc095e89cb6bbc4d4af95faff203f23fe13f83337aed6e8dda09e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b68616b696d6a616e6f766963682f757a2d70686f6e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/khakimjanovich/uz-phone)[![License](https://camo.githubusercontent.com/a46733ad9f96a4b33e0ea01fa34f6143838884093cbb56ff5bc2fc5fb0c21262/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b68616b696d6a616e6f766963682f757a2d70686f6e652e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Tests](https://camo.githubusercontent.com/5ab1461c7c233993a9056c5b3d3f737c96166c47ebcdee4e94ad11fdaa53e995/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b68616b696d6a616e6f766963682f757a2d70686f6e652f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/khakimjanovich/uz-phone/actions/workflows/tests.yml)[![Tests](https://camo.githubusercontent.com/afa169b010a19b7bea1bc8c20a1eaca5e4fa43880a41c4a47e52b010d40d0c50/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d506573742d6363336534342e7376673f7374796c653d666c61742d737175617265)](tests/UzPhoneNumberTest.php)

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.

```
use Khakimjanovich\UzPhone\Enum\Format;
use Khakimjanovich\UzPhone\UzPhoneNumber;

$phone_number = UzPhoneNumber::parse('(90) 123-45-67');

echo $phone_number;                         // +998901234567
echo $phone_number->format(Format::MASKED); // +998 90 *** ** 67
```

Why
---

[](#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/phonenumber` for phone-number parsing and formatting
- Keeps Uzbek prefix type and operator data in this package

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

[](#installation)

```
composer require khakimjanovich/uz-phone
```

Requires PHP 8.2 or newer.

Usage
-----

[](#usage)

```
