IS_IP_ADDRESS_IN_RANGE
DESCRIPTION
IS_IP_ADDRESS_IN_RANGE
is used to determine whether an IP address is within a certain network range. This function accepts an IP address and a network range represented in CIDR notation, returning a boolean value indicating whether the IP address is within the specified network range.
Syntax
Parameter Description
- address: The IP address to be checked, which can be in the form of an IPv4 or IPv6 address string.
- prefix: Represents the network range in CIDR notation, also a string.
Return Result
Returns true if the IP address is within the specified network range, and false if the IP address is not within the specified network range.
Example
Example 1: IPv4 Address Range Check
Example 2: IPv6 Address Range Check