Bitrix API

IpAddress

Table of Contents

Methods

__construct()  : mixed
__toString()  : string
Returns address's value.
createByName()  : static
Creates the object by a host name.
createByUri()  : static
Creates the object by a Uri.
get()  : string
Returns address's value.
isIPv4()  : bool
Retuns true if the address is IPv4.
isPrivate()  : bool
Retuns true if the address is incorrect or private.
matchRange()  : bool
Check IPv4 address is within an IP range
toRange()  : string
Formats IP as a range (192.168.0.0/24).
toUnsigned()  : string
Formats IP as an unsigned int and returns it as a sting.

Methods

__construct()

public __construct(string $ip) : mixed
Parameters
$ip : string

__toString()

Returns address's value.

public __toString() : string
Return values
string

createByName()

Creates the object by a host name.

public static createByName(string $name) : static
Parameters
$name : string
Return values
static

createByUri()

Creates the object by a Uri.

public static createByUri(UriInterface $uri) : static
Parameters
$uri : UriInterface
Return values
static

get()

Returns address's value.

public get() : string
Return values
string

isIPv4()

Retuns true if the address is IPv4.

public isIPv4() : bool
Return values
bool

isPrivate()

Retuns true if the address is incorrect or private.

public isPrivate() : bool
Return values
bool

matchRange()

Check IPv4 address is within an IP range

public matchRange(string $cidr) : bool
Parameters
$cidr : string

a valid IPv4 subnet[/mask]

Return values
bool

toRange()

Formats IP as a range (192.168.0.0/24).

public toRange(int $prefixLen) : string
Parameters
$prefixLen : int
Return values
string

toUnsigned()

Formats IP as an unsigned int and returns it as a sting.

public toUnsigned() : string
Return values
string

        
On this page

Search results