PHPackages                             hyqo/ip-utils - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hyqo/ip-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hyqo/ip-utils
=============

1.0.0(3y ago)0271MITPHPPHP ^8.0

Since Mar 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hyqo/ip-utils)[ Packagist](https://packagist.org/packages/hyqo/ip-utils)[ RSS](/packages/hyqo-ip-utils/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

ip-utils
========

[](#ip-utils)

[![Packagist Version](https://camo.githubusercontent.com/d55971891420f4b391c82e8e07293679f12855e5794a7585b03e6fca9bc38a38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6879716f2f69702d7574696c733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/d55971891420f4b391c82e8e07293679f12855e5794a7585b03e6fca9bc38a38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6879716f2f69702d7574696c733f7374796c653d666c61742d737175617265)[![Packagist PHP Version Support](https://camo.githubusercontent.com/8aa640bdac399231d9ec83cbb8f6cee58e690e7e66e981d6d1bdbffc720ca42e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6879716f2f69702d7574696c733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/8aa640bdac399231d9ec83cbb8f6cee58e690e7e66e981d6d1bdbffc720ca42e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6879716f2f69702d7574696c733f7374796c653d666c61742d737175617265)[![GitHub Workflow Status](https://camo.githubusercontent.com/7fcb960c60d2fb249914c883eb33071c41a022df31d33eae2db2f35baee4e17c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6879716f2f69702d7574696c732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/7fcb960c60d2fb249914c883eb33071c41a022df31d33eae2db2f35baee4e17c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6879716f2f69702d7574696c732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)

Install
-------

[](#install)

```
composer require hyqo/ip-utils
```

Methods
-------

[](#methods)

```
IpInterface::isValid(string $ip): bool;
IpInterface::isMatch(string $ip, string|array $subnets): bool;
IpInterface::normalize(string $ip): string;
IpInterface::port(string $ip): ?int;
```

Usage
-----

[](#usage)

```
use Hyqo\Utils\Ip\Ip;

Ip::isValid('192.168.1.0'); //true
Ip::isValid('0:0:0:0:0:0:0:1'); //true

Ip::isMatch('131.0.72.199', '131.0.72.0/22'); //true
Ip::isMatch('131.0.76.199', '131.0.72.0/22'); //false

Ip::isMatch('132.0.72.199', ['131.0.72.0/22', '192.168.1.0/31']); //true

Ip::normalize('127.0.0.1:80'); //127.0.0.1
Ip::normalize('[::1]:80'); //::1

Ip::port('127.0.0.1:80'); //80
Ip::port('[::1]:80'); //80
```

The `Ip` class automatically detects IP version, but you can use `Ipv4` and `Ipv6` classes with the same methods as well.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

1169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4230413a88525a7581fb391836718bcca27b8d1698f97b61de0dd6d816fac41?d=identicon)[akeylimepie](/maintainers/akeylimepie)

---

Top Contributors

[![akeylimepie](https://avatars.githubusercontent.com/u/355106?v=4)](https://github.com/akeylimepie "akeylimepie (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hyqo-ip-utils/health.svg)

```
[![Health](https://phpackages.com/badges/hyqo-ip-utils/health.svg)](https://phpackages.com/packages/hyqo-ip-utils)
```

###  Alternatives

[kubotak-is/php-del

Tool to remove code based on specific comments.

1640.8k](/packages/kubotak-is-php-del)[turanjanin/serbian-transliterator

Transliterate between Serbian Cyrillic and Latin scripts.

1217.0k](/packages/turanjanin-serbian-transliterator)

PHPackages © 2026

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