Functions

Generic IDNA 2008 domain decoding.

idna2_decode(string $domain) : string
package Default

Parameters

$domain

string

Returns

string

Generic IDNA 2008 domain encoding.

idna2_encode(string $domain) : string
package Default

Parameters

$domain

string

Returns

string

Get error message from last function call.

idna2_error() : string | false
package Default

Returns

stringfalse

Convert an UTF-8 encoded string to an array of Unicode code points.

idna2_from_utf8(string $label) : array
package Default
see

Parameters

$label

string

Returns

array

Split a domain name into labels.

idna2_labels(string $domain) : array

The IDNA label delimiters '.', U+3002, U+FF0E, U+FF61 are considered.

package Default

Parameters

$domain

string

Returns

array

Apply the Nameprep Algorithm (IDNA 2003).

idna2_nameprep(string $domain, boolean $allowUnassigned = false) : string
package Default

Parameters

$domain

string

$allowUnassigned

boolean

Whether to allow UNASSIGNED code points.

Returns

string

Decode an ASCII string by way of the Puncode algorithm.

idna2_punycode_decode(string $label) : string | false

Note that strings are considered without the "xn--" prefix here.

This is the reverse of idna2_punycode_encode()

package Default

Parameters

$label

string

Encoded ASCII label

Returns

stringfalse

Apply the Puncode algorithm to a UTF-8 string.

idna2_punycode_encode(string $label) : string | false

Note that strings are considered without the "xn--" prefix here.

This is the reverse of idna2_punycode_decode()

package Default

Parameters

$label

string

Unicode label

Returns

stringfalse

Test an UTF-8 encoded string against various IDNA requirements, specified by the flags parameter.

idna2_test(string $domain, integer $flags) : integer

The return value contains

package Default
see constants

Parameters

$domain

string

$flags

integer

Returns

integer

IDNA 2003 ToAscii method.

idna2_to_ascii(string $domain, boolean $allowUnassigned = false, boolean $useStd3Ascii = true) : string
package Default

Parameters

$domain

string

$allowUnassigned

boolean

Whether to allow UNASSIGNED code points.

$useStd3Ascii

boolean

Whether to apply Std3ASCII rules.

Returns

string

IDNA 2003 ToUnicode method.

idna2_to_unicode(string $domain, boolean $allowUnassigned = false, boolean $useStd3Ascii = true) : string
package Default

Parameters

$domain

string

$allowUnassigned

boolean

Whether to allow UNASSIGNED code points.

$useStd3Ascii

boolean

Whether to apply Std3ASCII rules.

Returns

string

Get UTF-8 encoded string from an array of Unicode codepoints.

idna2_to_utf8(array $codepoints) : string

This is the reverse of idna2_from_utf8().

package Default
see

Parameters

$codepoints

array

An array of integers representing Unicode code points.

Returns

string

Constants

 

Check requirements as specified by the IDNA 2008 lookup protocol.

IDNA2_CHECK_2008_LOOKUP = 0 
package Default
 

Check requirements as specified by the IDNA 2008 registration protocol.

IDNA2_CHECK_2008_REGIST = 0 
package Default
 

Check whether the string contains non-ASCII characters.

IDNA2_CHECK_ASCII = 0 
package Default
 

Check requirements specified in [IDNA2008-BIDI].

IDNA2_CHECK_BIDI = 0 
package Default
 

Check for labels beginning with a combining mark.

IDNA2_CHECK_COMBINING = 0 
package Default
 

Check CONTEXTJ code points.

IDNA2_CHECK_CONTEXTJ = 0 
package Default
 

Check CONTEXTO code points for the lookup protocol.

IDNA2_CHECK_CONTEXTO_LOOKUP = 0 
package Default
 

Check CONTEXTO code points for the registration protocol.

IDNA2_CHECK_CONTEXTO_REGIST = 0 
package Default
 

Check whether the string does not start nor end with HYPHEN_MINUS '-'.

IDNA2_CHECK_HYPHEN = 0 
package Default
 

Check whether the string contains HYPHEN_MINUS '-' at the 3rd and 4th position.

IDNA2_CHECK_HYPHEN34 = 0 
package Default
 

Apply checks for non-LDH ASCII characters.

IDNA2_CHECK_LDH = 0 
package Default
 

Apply length checks on labels and domain names according to the IDNA standard.

IDNA2_CHECK_LENGTH = 0 
package Default
 

Check labels are in NFC.

IDNA2_CHECK_NFC = 0 
package Default
 

Check for PROHIBITED code points.

IDNA2_CHECK_PROHIBITED = 0 
package Default
 

Check for Std3 ASCII rules.

IDNA2_CHECK_STD3 = 0 
package Default
 

Check for UNASSIGNED code points.

IDNA2_CHECK_UNASSIGNED = 0 
package Default
 

Perform IDNA 2003 mapping procedures.

IDNA2_MAP_IDNA2003 = 0 
package Default
 

Perform IDNA 2008 mapping procedures.

IDNA2_MAP_IDNA2008 = 0 
package Default
 

Apply the IDNA 2003 Nameprep algorithm.

IDNA2_MAP_NAMEPREP = 0 
package Default
 

Apply Unicode normalization form C and map characters to lower case.

IDNA2_MAP_NFCLOWER = 0 
package Default
 

Normalize strings with the Unicode Normalization form KC.

IDNA2_MAP_NFKC = 0 
package Default
 

Apply the Punycode algorithm.

IDNA2_MAP_PUNYCODE = 0 
package Default