php-ip icon indicating copy to clipboard operation
php-ip copied to clipboard

Feature to extract CIDR netmask

Open pertoft opened this issue 7 years ago • 2 comments

Thanks for the nice library. Im missing a feature to get the mask() in cidr.

Example: $block = new IPv4Block('128.0.0.0/16'); $block->getMask() = 255.255.0.0

Wish: $block->getMaskCIDR() = 16

pertoft avatar Mar 14 '17 07:03 pertoft

$block->getPrefix() should do it.

haegar avatar Mar 14 '17 08:03 haegar

Indeed there is $block->getPrefix() for that. I need to update the documentation!

rlanvin avatar Mar 14 '17 11:03 rlanvin