PHPackages                             jorisros/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. jorisros/iptools

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

jorisros/iptools
================

A set of tools that checks and validates ipaddress.

v1.4(7y ago)1831MITPHPPHP &gt;=7.1

Since Aug 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jorisros/iptools)[ Packagist](https://packagist.org/packages/jorisros/iptools)[ RSS](/packages/jorisros-iptools/feed)WikiDiscussions development Synced 3d ago

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

[![GitHub Workflow Status](https://camo.githubusercontent.com/97bc796ae4113b7a2fc48b8f8e627617588870d1e7316f6f7a575396dd8116a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f726973726f732f6970746f6f6c732f74657374732e79616d6c)](https://camo.githubusercontent.com/97bc796ae4113b7a2fc48b8f8e627617588870d1e7316f6f7a575396dd8116a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f726973726f732f6970746f6f6c732f74657374732e79616d6c)[![Packagist License](https://camo.githubusercontent.com/5847cd3c2f684a42b13774541378a30d8bf353fab6936c28a65a1a5ca13a0cba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f726973726f732f6970746f6f6c73)](https://camo.githubusercontent.com/5847cd3c2f684a42b13774541378a30d8bf353fab6936c28a65a1a5ca13a0cba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f726973726f732f6970746f6f6c73)[![Packagist PHP Version](https://camo.githubusercontent.com/8087a59081630faf3abcf38b4a7186b93c2a159e4bf5b868a3bc189d1268919e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6a6f726973726f732f6970746f6f6c732f706870)](https://camo.githubusercontent.com/8087a59081630faf3abcf38b4a7186b93c2a159e4bf5b868a3bc189d1268919e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6a6f726973726f732f6970746f6f6c732f706870)[![Maintainability](https://camo.githubusercontent.com/2e93b7ce2294e96258027ab87c39f2ddcc898166528a2cbaa14b96989072ce8e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36353039626564636264353939376236646230652f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/jorisros/iptools/maintainability)

Iptools
=======

[](#iptools)

A set of tools that checks and validates ipaddress.

Detect if the ipaddress is valid:

```
\JorisRos\IpTools::validateIp('192.168.192.13');
```

Detects if ipaddress is allowed in given range, by a minus sign between two ipadresses:

```
\JorisRos\IpTools::isIpInRange('192.168.192.13', '192.168.192.12-192.168.192.14');
```

Detects if ipaddress is allowed in given range, by a wildcard sign:

```
\JorisRos\IpTools::isIpInRange('192.168.192.13', '192.168.192.*,192.168.192.*');
```

Detects if ipaddress is allowed in given range, by a subnet:

```
\JorisRos\IpTools::isIpInRange('192.168.192.13', '192.168.192.0/24');
```

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

[](#installation)

Installation can be done by composer

```
composer require jorisros/iptools

```

And use the autoloader to load it

```
