PHPackages                             kigkonsult/iptools - 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. kigkonsult/iptools

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

kigkonsult/iptools
==================

ipv4/ipv6 tools

v1.6(5y ago)980.9k↓13.6%LGPL-3.0-or-laterPHPPHP &gt;=8.0

Since Apr 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/iCalcreator/ipTools)[ Packagist](https://packagist.org/packages/kigkonsult/iptools)[ Docs](http://kigkonsult.se)[ Fund](https://paypal.me/kigkonsult)[ RSS](/packages/kigkonsult-iptools/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

ipTools
=======

[](#iptools)

> is a PHP IP number utility toolbox

"Don't thrust an IP address... ", but sometime you have to deal with them.

Provides IP v4/v6

- validation: IP in IP/network(cidr) ranges

and util services:

- is valid IP
- expand/compress IP number
- IP number to binary and reverse
- netmask/cidr etc

###### INSTALL

[](#install)

[Composer](https://getcomposer.org/)

```
composer require kigkonsult/ipTools

```

Version 1.6 supports PHP 8.0. 1.4 7.4, 1.3 7.0.

or add

```
require_once '[path/]ipTools/autoload.php';

```

to your PHP-script

Namespace is Kigkonsult\\IpTools.

#### Sponsorship

[](#sponsorship)

Donation using [paypal.me/kigkonsult](https://paypal.me/kigkonsult) are appreciated. For invoice, please [e-mail](mailto:ical@kigkonsult.se).

###### USAGE

[](#usage)

IpTools 2.0 require PHP7+

How to check an IPv4/v6 number is valid and in a validity range :

**1** Build a validity range filter

```
