Skip to content

Instantly share code, notes, and snippets.

@tuxis-ie
Created September 21, 2015 09:40
$net = Net_IPv4::parseAddress($addr['prefix']);
$addresses = 2**(32-$net->bitmask);
$start = ip2long($net->network);
for ($i = 1; $i <= $addresses; $i++) {
print long2ip($start+$i);
print "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment