Locale::getAllVariants

locale_get_all_variants

Gets the variants for the input locale

&reftitle.description;

&style.oop;

public static ``array``null```Locale::getAllVariants` `string` `locale`

&style.procedural;

``array``null```locale_get_all_variants` `string` `locale`

Gets the variants for the input locale

&reftitle.parameters;

`locale`

- The locale to extract the variants from

&reftitle.returnvalues;

The `array` containing the list of all variants subtag for the locale or &null; if not present

&intl.locale-len.return;
&reftitle.examples;

### `locale_get_all_variants` example

    <?php
    $arr = locale_get_all_variants('sl_IT_NEDIS_ROJAZ_1901');
    var_export( $arr );
    ?>

### OO example

    <?php
     $arr = Locale::getAllVariants('sl_IT_NEDIS_ROJAZ_1901');
     var_export( $arr );
    ?>

&example.outputs;

    array (
        0 => 'NEDIS',
        1 => 'ROJAZ',
        2 => '1901',
    )

&reftitle.seealso;

- `locale_get_primary_language`
- `locale_get_script`
- `locale_get_region`