pm_Checker:: ip_address_and_mask Method

Checks whether the specified IP address presents the expected type of IP address (non-masked IP address, masked IP address, masked IP range, etc.).

Syntax

public static function ip_address_and_mask ($ip_address, $ip_mask, $valid)

Parameters

ip_address

      A string value that specifies the IP address used to specify a valid subnet.

ip_mask

      A string value that specifies the IP mask used to specify a valid subnet.

valid

      A string value that specifies the validation rule to apply. Is set to IP_ADDRESS_ANY by default. The following validation rules are available:

Returns

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.

Remarks

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.).