Skip to content
PHP Ecosystem
Explore

IpHelper

API reference › yii › helpers › IpHelper

classyii\helpers\IpHelper
ExtendsBaseIpHelper
Since2.0.14
Sourceframework/helpers/IpHelper.php

Class IpHelper provides a set of IP-related static methods.

Methods expect correct IP addresses. To validate IP addresses use IpValidator.

MethodDescriptionDefined by
expandIPv6() staticExpands an IPv6 address to it’s full notation.BaseIpHelper
getIpVersion() staticGets the IP version. Does not perform IP address validation.BaseIpHelper
inRange() staticChecks whether IP address or subnet $subnet is contained by $subnet.BaseIpHelper
ip2bin() staticConverts IP address to bits representation.BaseIpHelper
ConstantValueDescriptionDefined by
IPV44BaseIpHelper
IPV66BaseIpHelper
IPV6_ADDRESS_LENGTH128The length of IPv6 address in bitsBaseIpHelper
IPV4_ADDRESS_LENGTH32The length of IPv4 address in bitsBaseIpHelper