Class IPAddress

Methods summary

public
# __construct( string|null $ipAddress = null, boolean $isHex = false )

Builds the IPAddress object from the ip address string provided, or from a hexadecimal string If no ip address is provided, it can be set later by running the setIp function

public
# setIp( string $ipAddress, boolean $isHex = false )

Sets the current IP Address

public string|null
# getIp( integer $format = Concrete\Core\Utility\IPAddress::FORMAT_HEX )

Returns the IPAddress string, null if no ip address has been set

protected boolean
# isIpSet( )
public string
# hex2bin( string $hex )

Fallback function for those using < PHP 5.4 Decodes a hexadecimally encoded binary string

public boolean
# isLoopBack( )

Used to check of the current IP is a loopback IP address

public boolean
# isPrivate( )

Returns true if the IP address belongs to a private network, false if it is not

public boolean
# isLinkLocal( )

Returns true if the IP is a Link-local address, false if it is not

public
# isIPv4( )
public
# isIPv6( )

Constants summary

integer FORMAT_HEX
# 0
integer FORMAT_IP_STRING
# 1

Properties summary

protected $ipHex
# null