Method | Description | |
---|---|---|
__construct ( string $range ) | Constructor for the class. | |
containsIp ( string $ipAddress ) : boolean | Returns whether or not a given IP address falls within this range. | |
getLowerInt ( ) : integer | Returns the lower value of the IPv4 range as a long integer. | |
getUpperInt ( ) : integer | Returns the upper value of the IPv4 range as a long integer. |
Method | Description | |
---|---|---|
computeLowerAndUpperBounds ( string $range ) | Computes the lower and upper bounds of the IPv4 range by parsing the range string. | |
parseCidrRange ( string $range ) : array | Parses a CIDR notation range. | |
parseHyphenRange ( string $range ) : array | Parses a hyphen notation range. | |
parseWildcardRange ( string $range, integer $pos ) : array | Parses a wildcard notation range. |
public __construct ( string $range ) | ||
$range | string | A valid IPv4 range as a string. Supported range styles: - CIDR notation (127.0.0.1/24) - hyphen notation (127.0.0.1-127.0.0.255) - wildcard notation (127.0.0.*) - a single specific IP address (127.0.0.1) |
public containsIp ( string $ipAddress ) : boolean | ||
$ipAddress | string | The given IP address. |
return | boolean | Returns true if the IP address falls within the range and false otherwise. |
public getLowerInt ( ) : integer | ||
return | integer | The lower value of the IPv4 range. |
public getUpperInt ( ) : integer | ||
return | integer | The upper value of the IPv4 range. |