PHPackages                             morsvox/ip-range-checker - 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. morsvox/ip-range-checker

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

morsvox/ip-range-checker
========================

This package is a little helper to check if a given IP address is in a certain IP range.

v1.0.0(3y ago)014.4k↓43.6%MITPHP

Since Mar 6Pushed 3y ago1 watchersCompare

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

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

IP Range Checker
================

[](#ip-range-checker)

This is a simple helper package that I use when I need to check if an IP is in a given IP range.

All ideas, contributions and criticism are welcome.

Installation
============

[](#installation)

```
composer require morsvox/ip-range-checker
```

Usage
=====

[](#usage)

Import the class in your script:

```
use IlkerMutlu\IPRangeChecker\Checker;

$ip = '192.168.0.22';
$checker = Checker::forIp($ip);
```

Pass the start IP and end IP in an array to the `setRange()` method.

```
$checker->setRange([
    '192.168.0.1',
    '192.168.0.28'
]);

// $checker->check() will return true for IPs between
// 192.168.0.1 and 192.168.0.28
// 192.168.0.19 will return TRUE
// 192.168.1.41 will return FALSE
```

You can also use a wildcard.

```
$checker->setRange('192.168.0.*');

// $checker->check() will return TRUE for IPs between
// 192.168.0.1 and 192.168.0.255
// 192.168.0.41 will return TRUE
// 192.168.1.41 will return FALSE
```

OR, you can pass in two IPs separated with a dash.

```
$checker->setRange('192.168.0.4-192.168.0.54');

// $checker->check() will return TRUE for IPs between
// 192.168.0.4 and 192.168.0.54
// 192.168.0.41 will return TRUE
// 192.168.0.61 will return FALSE
```

After setting the range, just call the `check()` method on the checker instance, which will return a boolean value.

```
$checker->check();
```

TODO
----

[](#todo)

1. Tests
2. Support dashed IP range strings
3. Support CIDR

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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/306440135290b964ca9dd9e989e0b4450d61c2c7923abb083d92973008a78446?d=identicon)[coursondev](/maintainers/coursondev)

---

Top Contributors

[![morsvox](https://avatars.githubusercontent.com/u/8248449?v=4)](https://github.com/morsvox "morsvox (1 commits)")

---

Tags

checkIPrangeip-address

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/morsvox-ip-range-checker/health.svg)

```
[![Health](https://phpackages.com/badges/morsvox-ip-range-checker/health.svg)](https://phpackages.com/packages/morsvox-ip-range-checker)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.2M24](/packages/s1lentium-iptools)[kartik-v/yii2-date-range

An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.

894.4M42](/packages/kartik-v-yii2-date-range)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

177813.7k6](/packages/markrogoyski-ipv4-subnet-calculator)[rlanvin/php-ip

IPv4/IPv6 manipulation library for PHP

180738.8k11](/packages/rlanvin-php-ip)

PHPackages © 2026

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