php8.5
Home/ Manual/ intl / locale/ Locale::addLikelySubtags

Locale::addLikelySubtags

PHP function Edit on GitHub ✎

Add likely subtags to a locale

Description

Oop

Locale::addLikelySubtags(string $locale): string|false

Procedural

locale_add_likely_subtags(string $locale): string|false

Expands a locale tag by adding likely subtags based on the ICU locale data. For example, en becomes en_Latn_US.

Parameters

locale

The locale to expand.

Return Values

Returns the locale with likely subtags added, or false on failure.

Errors/Exceptions

Throws a ValueError when the locale argument contains null bytes.

See Also

  • Locale::minimizeSubtags
  • Locale::canonicalize

Source: reference/intl/locale/add-likely-subtags.xml · from the official PHP manual (php/doc-en)