CakeFest 2024: The Official CakePHP Conference

NumberFormatter::getLocale

numfmt_get_locale

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

NumberFormatter::getLocale -- numfmt_get_localeBiçemleyici yerelin ismi ile döner

Açıklama

Nesne yönelimli kullanım

public NumberFormatter::getLocale(int $tür = ULOC_ACTUAL_LOCALE): string|false

Yordamsal kullanım

numfmt_get_locale(NumberFormatter $biçemleyici, int $tür = ULOC_ACTUAL_LOCALE): string|false

Biçemleyici yerelin ismi ile döner.

Bağımsız Değişkenler

fmt

NumberFormatter nesnesi.

tür

Geçerli yereli Locale::VALID_LOCALE sabitiyle fiili yereli Locale::ACTUAL_LOCALE sabitiyle belirtebilirsiniz. Fiili yerel öntanımlıdır.

Dönen Değerler

Biçemleyici yerelin ismi, başarısızlık durumunda false döner.

Örnekler

Örnek 1 - numfmt_get_locale() örneği

<?php
$req
= 'tr_TR_OTTOMAN';
$fmt = numfmt_create( $req, NumberFormatter::DECIMAL);
$res_val = numfmt_get_locale( $fmt, Locale::VALID_LOCALE );
$res_act = numfmt_get_locale( $fmt, Locale::ACTUAL_LOCALE );
printf( "İstenen yerel ismi: %s\nGeçerli yerel ismi: %s\nFiili yerel ismi: %s\n",
$req, $res_val, $res_act );
?>

Yukarıdaki örneğin çıktısı:

İstenen yerel ismi: tr_TR_OTTOMAN
Geçerli yerel ismi: tr_TR
Fiili yerel ismi: tr

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top