Locale::acceptFromHttp
locale_accept_from_http
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Locale::acceptFromHttp -- locale_accept_from_http — HTTP "Accept-Language" başlığıyla en iyi eşleşen yereli bulmaya çalışır
Açıklama
Nesne yönelimli kullanım
static
string
Locale::acceptFromHttp
( string
$başlık
)Yordamsal kullanım
string
locale_accept_from_http
( string
$başlık
)HTTP "Accept-Language" başlığında talep edilen dillerle en uyumlu yereli bulmaya çalışır.
Değiştirgeler
-
başlık -
"Accept-Language" başlığını RFC 2616'daki biçeme uygun olarak içeren dizge .
Dönen Değerler
Başlıkla eşleşen yerel.
Örnekler
Örnek 1 - locale_accept_from_http() örneği
<?php
$locale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
echo $locale;
?>
Örnek 2 - Nesne yönelimli kullanım örneği
<?php
$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
echo $locale;
?>
Yukarıdaki örneğin çıktısı:
tr_TR
There are no user contributed notes for this page.
