array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'datetimezone.getlocation.php', 1 => 'DateTimeZone::getLocation', ), 'up' => array ( 0 => 'class.datetimezone.php', 1 => 'DateTimeZone', ), 'prev' => array ( 0 => 'datetimezone.construct.php', 1 => 'DateTimeZone::__construct', ), 'next' => array ( 0 => 'datetimezone.getname.php', 1 => 'DateTimeZone::getName', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/datetime/datetimezone/getlocation.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
DateTimeZone::getLocation -- timezone_location_get — タイムゾーンの位置情報を返す
オブジェクト指向型
手続き型
タイムゾーンの位置情報 (国コード、緯度/経度、コメント) を返します。
タイムゾーンについての位置情報を含む配列を返します。失敗した場合に false
を返します
例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] => )