cyberline/ip-net-calc

Compute the common mask from multiple IP addresses

v1.0 2014-11-14 10:32 UTC

This package is auto-updated.

Last update: 2024-04-29 03:26:48 UTC


README

Scrutinizer Code Quality Build Status SensioLabsInsight Latest Stable Version Total Downloads Latest Unstable Version License

Compute the common mask from multiple IP addresses

Example

<?php
require_once 'IpNetCalc.php';

// returns: 192.168.0.0/22
$ip = new IpNetCalc\IpNetCalc();
print $ip->calcNetSum(array('192.168.0.1', '192.168.2.40'));

// returns: 2000::/4
print $ip->calcNetSum(array('2a00:1450:8004::69', '2001:1af8:1:f006::6'));