Internationalization Locale::setDefault
Locale::setDefault
locale_set_default
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
Locale::setDefault -- locale_set_default — 기본 런타임 로케일을 설정합니다.
설명
객체 지향 스타일
public static Locale::setDefault(string $locale
): bool
절차적 스타일
locale_set_default(string $locale
): bool
기본 런타임 로케일을 locale
로 설정합니다. 이것은 INTL 전역 'default_locale' 로케일 식별자의 값을 변경합니다. UAX #35 확장이 허용됩니다.
매개변수
locale
- BCP 47 호환 언어 태그입니다.
반환 값
true
를 반환합니다.
Examples
예제 #1 locale_set_default() 예제
<?php
locale_set_default('de-DE');
echo locale_get_default();
?>
예제 #2 OO 예제
<?php
Locale::setDefault('de-DE');
echo Locale::getDefault();
?>
위의 예는 다음을 출력합니다.
de-DE
기타
- locale_get_default() - INTL 전역 'default_locale'에서 기본 로케일 값을 가져옵니다.