Method NetUtils.cidr_to_netmask()


Method cidr_to_netmask

array(int)|zero cidr_to_netmask(string|zero cidr)

Description

Converts a string with an IP address and mask (in CIDR notation) into a binary IP address and bitmask.

Parameter cidr

The CIDR-notation input string.

Returns

An array containing:

Array
int ip

The binary representation of the IP address.

int mask

The bitmask.

Returns 0 if the string could not be parsed.