DomainName
extends Type
in package
Represents a fully qualified domain name
Tags
Table of Contents
Constants
- FLAG_NO_COMPRESSION = \PHP_INT_SIZE === 4 ? -2147483648 : 0x80000000
Properties
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
$value
protected
string
$value
= ''
$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
__toString()
Magic method for type coercion to string
public
__toString() : string
Return values
stringgetLabels()
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
setValue()
Set the internal value
public
setValue(string $value) : mixed
Parameters
- $value : string
-
The new value