Documentation

DomainName extends Type
in package

Represents a fully qualified domain name

Tags
category

LibDNS

author

Chris Wright https://github.com/DaveRandom

Table of Contents

Constants

FLAG_NO_COMPRESSION  = \PHP_INT_SIZE === 4 ? -2147483648 : 0x80000000

Properties

$value  : string
$labels  : array<string|int, string>

Methods

__construct()  : mixed
Constructor
__toString()  : string
Magic method for type coercion to string
getLabels()  : array<string|int, string>
Get the domain name labels
getValue()  : mixed
Get the internal value
setLabels()  : mixed
Set the domain name labels
setValue()  : mixed
Set the internal value

Constants

FLAG_NO_COMPRESSION

public mixed FLAG_NO_COMPRESSION = \PHP_INT_SIZE === 4 ? -2147483648 : 0x80000000

Properties

$labels

private array<string|int, string> $labels = []

The value as a list of labels

Methods

__construct()

Constructor

public __construct([string|array<string|int, string> $value = null ]) : mixed
Parameters
$value : string|array<string|int, string> = null
Tags
throws
UnexpectedValueException

When the supplied value is not a valid domain name

__toString()

Magic method for type coercion to string

public __toString() : string
Return values
string

getLabels()

Get the domain name labels

public getLabels([bool $tldFirst = false ]) : array<string|int, string>
Parameters
$tldFirst : bool = false

Whether to return the label list ordered with the TLD label first

Return values
array<string|int, string>

getValue()

Get the internal value

public getValue() : mixed

setLabels()

Set the domain name labels

public setLabels(array<string|int, string> $labels[, bool $tldFirst = false ]) : mixed
Parameters
$labels : array<string|int, string>

The new label list

$tldFirst : bool = false

Whether the supplied label list is ordered with the TLD label first

Tags
throws
UnexpectedValueException

When the supplied label list is not a valid domain name

setValue()

Set the internal value

public setValue(string $value) : mixed
Parameters
$value : string

The new value

Tags
throws
UnexpectedValueException

When the supplied value is not a valid domain name


        
On this page

Search results