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

Locale::minimizeSubtags

PHP function Edit on GitHub ✎

Remove likely subtags from a locale

Description

Oop

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

Procedural

locale_minimize_subtags(string $locale): string|false

Minimizes a locale tag by removing subtags that can be inferred using the ICU likely subtag data. For example, en_Latn_US becomes en.

Parameters

locale

The locale to minimize.

Return Values

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

Errors/Exceptions

Throws a ValueError when the locale argument contains null bytes.

See Also

  • Locale::addLikelySubtags
  • Locale::canonicalize

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