yii\helpers\IpHelper - Yii2 类参考手册
Class yii\helpers\IpHelper
Inheritance | yii\helpers\IpHelper » yii\helpers\BaseIpHelper |
---|---|
Available since version | 2.0.14 |
Class IpHelper provides a set of IP-related static methods.
Methods expect correct IP addresses. To validate IP addresses use IpValidator.
Public Methods
隐藏继承的方法 Hide inherited methods
方法 Method | 简介 Description | 定义在 Defined By |
---|---|---|
expandIPv6() | Expands an IPv6 address to it's full notation. | yii\helpers\BaseIpHelper |
getIpVersion() | Gets the IP version. Does not perform IP address validation. | yii\helpers\BaseIpHelper |
inRange() | Checks whether IP address or subnet $subnet is contained by $subnet. | yii\helpers\BaseIpHelper |
ip2bin() | Converts IP address to bits representation. | yii\helpers\BaseIpHelper |
常量 Constants
隐藏继承的常量 Hide inherited constants
常量 Constant | 值 Value | 简介 Description | 定义在 Defined By |
---|---|---|---|
IPV4 | 4 | yii\helpers\BaseIpHelper | |
IPV4_ADDRESS_LENGTH | 32 | The length of IPv4 address in bits | yii\helpers\BaseIpHelper |
IPV6 | 6 | yii\helpers\BaseIpHelper | |
IPV6_ADDRESS_LENGTH | 128 | The length of IPv6 address in bits | yii\helpers\BaseIpHelper |