Locale::getDisplayName

locale_get_display_name

Returns an appropriately localized display name for the input locale

&reftitle.description;

&style.oop;

public static ``string``false```Locale::getDisplayName` `string` `locale` ``string``null```displayLocale`&null;

&style.procedural;

``string``false```locale_get_display_name` `string` `locale` ``string``null```displayLocale`&null;

Returns an appropriately localized display name for the input locale. If `locale` is &null; then the default locale is used.

&reftitle.parameters;

`locale`

- The locale to return a display name for.

`displayLocale`

- optional format locale

&reftitle.returnvalues;

Display name of the locale in the format appropriate for `displayLocale`, &return.falseforfailure;.

&reftitle.changelog;

&Version; | &Description;
8.0.0 | `displayLocale` is nullable now.

&reftitle.examples;

### `locale_get_display_name` example

    <?php
    echo locale_get_display_name('sl-Latn-IT-nedis', 'en');
    echo ";\n";
    echo locale_get_display_name('sl-Latn-IT-nedis', 'fr');
    echo ";\n";
    echo locale_get_display_name('sl-Latn-IT-nedis', 'de');
    ?>

### OO example

    <?php
    echo Locale::getDisplayName('sl-Latn-IT-nedis', 'en');
    echo ";\n";
    echo Locale::getDisplayName('sl-Latn-IT-nedis', 'fr');
    echo ";\n";
    echo Locale::getDisplayName('sl-Latn-IT-nedis', 'de');
    ?>

&example.outputs;

    Slovenian (Latin, Italy, Natisone dialect);
    slov\xc3\xa8ne (latin, Italie, dialecte de Natisone;
    Slowenisch (Lateinisch, Italien, NEDIS)

&reftitle.seealso;

- `locale_get_display_language`
- `locale_get_display_script`
- `locale_get_display_region`
- `locale_get_display_variant`