Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Locale::lookupLocale::parseLocale>
^LocaleLast updated: Mon, 26 Oct 2026

Locale::minimizeSubtags

locale_minimize_subtags

(No version information available, might only be in Git)

Locale::minimizeSubtags -- locale_minimize_subtags — Remove likely subtags from a locale

Description

Object-oriented style

public static function Locale::minimizeSubtags(string $locale): string|false

Procedural style

function 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::lookupLocale::parseLocale>
^LocaleLast updated: Mon, 26 Oct 2026