Checks whether the specified IP address presents the expected type of IP address (non-masked IP address, masked IP address, masked IP range, etc.).
public static function ip_address_and_mask ($ip_address, $ip_mask, $valid)
A string value that specifies the IP address used to specify a valid subnet.
A string value that specifies the IP mask used to specify a valid subnet.
A string value that specifies the validation rule to apply. Is set to IP_ADDRESS_ANY by default. The following validation rules are available:
A boolean which is true if the specified IP address and IP mask are not 0.0.0.0 and the rule applied to them succeeds. Otherwise returns false.
This function applies the selected validation rule(s) to the combination of the IP address and IP mask to check whether the IP address really belongs to the expected type (a non-masked IP address, a masked IP address, an IP range, etc.).
184.108.40.206/16is a range of addresses, but
220.127.116.11/16is a particular IP address in a class B network.
18.104.22.168/255.255.255.255. The rule fails if the IP address has '0' bits in its host part, e.g.
22.214.171.124/16, or if it has all '1' bits in the host part
(a broadcast address