update : 2015.11.03
php.shukuma.com

검색:
 
 
Returns location information for a timezone

DateTimeZone::getLocation

timezone_location_get

(PHP 5 >= 5.3.0, PHP 7)

DateTimeZone::getLocation -- timezone_location_getReturns location information for a timezone

설명

객체 기반 형식

public array DateTimeZone::getLocation ( void )

절차식 형식

Returns location information for a timezone, including country code, latitude/longitude and comments.

인수

obejct

절차식 전용: timezone_open()이 반환하는 DateTimeZone 객체.

반환값

Array containing location information about timezone.

예제

Example #1 DateTimeZone::getLocation() example

<?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] => 
)