DateTimeZone::getLocation
timezone_location_get
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
DateTimeZone::getLocation -- timezone_location_get — 시간대에 대한 위치 정보를 반환합니다.
설명
객체 지향 스타일
public DateTimeZone::getLocation(): array|false
절차적 스타일
timezone_location_get(DateTimeZone $object
): array|false
국가 코드, 위도/경도 및 설명을 포함하여 시간대에 대한 위치 정보를 반환합니다.
매개변수
object
- 절차 스타일만 해당: timezone_open()에 의해 반환된 DateTimeZone 객체
반환 값
시간대에 대한 위치 정보가 포함된 배열 또는 실패 시 false
입니다.
Examples
예제 #1 DateTimeZone::getLocation() 예제
<?php
$tz = new DateTimeZone("Europe/Prague");
print_r($tz->getLocation());
print_r(timezone_location_get($tz));
?>
위의 예는 다음을 출력합니다.
Array ( [country_code] => CZ [latitude] => 50.08333 [longitude] => 14.43333 [comments] => ) Array ( [country_code] => CZ [latitude] => 50.08333 [longitude] => 14.43333 [comments] => )