IpHelper
API reference › yii › helpers › IpHelper
Class IpHelper provides a set of IP-related static methods.
Methods expect correct IP addresses. To validate IP addresses use IpValidator.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
expandIPv6() static | Expands an IPv6 address to it’s full notation. | BaseIpHelper |
getIpVersion() static | Gets the IP version. Does not perform IP address validation. | BaseIpHelper |
inRange() static | Checks whether IP address or subnet $subnet is contained by $subnet. | BaseIpHelper |
ip2bin() static | Converts IP address to bits representation. | BaseIpHelper |
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
IPV4 | 4 | BaseIpHelper | |
IPV6 | 6 | BaseIpHelper | |
IPV6_ADDRESS_LENGTH | 128 | The length of IPv6 address in bits | BaseIpHelper |
IPV4_ADDRESS_LENGTH | 32 | The length of IPv4 address in bits | BaseIpHelper |