S1lentium / IPTools

PHP Library for manipulating network addresses (IPv4 and IPv6)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

merge subnet

molchanov1983 opened this issue · comments

Hello
I found this
$subnets = Network::parse('192.168.0.0/22')->splitEqual('24');

foreach ($network as $ip) {
// 192.168.0.0/24
// 192.168.1.0/24
// 192.168.2.0/24
// 192.168.3.0/24
}

How to merge 4 new subnets to single subnet ?

 // 192.168.0.0/24
 // 192.168.1.0/24
 // 192.168.2.0/24
 // 192.168.3.0/24

=> 192.168.0.0/22

Is it possible to use your library to do this ?
Thanks