Civil Date PHP Package

LanguageTag
in package

FinalYes

Validates and inspects locale language tags.

Table of Contents

Methods

assertValid()  : void
Validates a locale language tag.
language()  : string
Returns the language subtag.
region()  : string|null
Returns the region subtag.

Methods

assertValid()

Validates a locale language tag.

public static assertValid(string $languageTag) : void
Parameters
$languageTag : string

Locale language tag.

Tags
throws
InvalidArgumentException

If the language tag is invalid.

language()

Returns the language subtag.

public static language(string $languageTag) : string
Parameters
$languageTag : string

Locale language tag.

Return values
string

Language subtag.

region()

Returns the region subtag.

public static region(string $languageTag) : string|null
Parameters
$languageTag : string

Locale language tag.

Return values
string|null

Region subtag, or null when the tag has no region.

On this page

Search results