webnium/network-address-group

Utility for grouped network address manipulation

1.0.4 2017-03-10 06:21 UTC

README

Coverage StatusBuild Status Utility for grouped network address manipulation

Installation

This library distributed via packagist.org.

Execute:

$ wget http://getcomposer.org/composer.phar
$ php composer.phar require webnium/network-address-group:~1.0

or add following to your composer.json

{
    "require": {
        "webnium/network-address-group": "~1.0"
    }
}

Usage

use Webnium\IpAddress\NetworkAddressGroup;

$group = new NetworkAddressGroup([
    '192.168.0.0/24',
    '192.168.2.0/24',
    '10.1.0.0/16',
    '10.0.1.64/27']);

var_dump($group->encloses('192.168.0.53')); // bool(true)
var_dump($group->encloses('192.168.1.1')); // bool(false)

License

MIT License