pm_Checker:: mask Method

Checks whether the specified subnet IP mask is valid.

Syntax

public static function mask ($mask)

Parameters

mask

      A string value that specifies the IP mask to check.

Returns

A boolean which is true if the IP mask is valid, false otherwise.

Remarks

A well-formatted IP mask should be formed according to the dotted-decimal notation. This notation implies that an IP mask consists of four blocks, each holding a value 0 to 255, delimited by dots. Besides, an IP mask shouldn't have its leftmost bits set to '0' and its rightmost bits set to '1'. The rightmost block(s) should be equal to 255, the intermediate blocks are expected to be within the following range: 128, 192, 224, 240, 248, 252, 254, 255. The leftmost block(s) should be set to 0.