<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.datetimezone.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'datetimezone.getlocation.php',
    1 => 'DateTimeZone::getLocation',
    2 => 'Returns location information for a timezone',
  ),
  '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' => 'en',
    'path' => 'reference/datetime/datetimezone/getlocation.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetimezone.getlocation" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTimeZone::getLocation</h1>
  <h1 class="refname">timezone_location_get</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTimeZone::getLocation</span> -- <span class="refname">timezone_location_get</span> &mdash; <span class="dc-title">Returns location information for a timezone</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetimezone.getlocation-description">
  <h3 class="title">Description</h3>
  <p class="para">Object-oriented style</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DateTimeZone::getLocation</strong></span>(): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">Procedural style</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><a href="function.timezone-location-get.php" class="methodname">timezone_location_get</a></span>(<span class="methodparam"><span class="type"><a href="class.datetimezone.php" class="type DateTimeZone">DateTimeZone</a></span> <code class="parameter">$object</code></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Returns location information for a timezone, including country code, latitude/longitude and comments.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetimezone.getlocation-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">object</code></dt><dd><p class="para">Procedural style only: A <span class="classname"><a href="class.datetimezone.php" class="classname">DateTimeZone</a></span> object
returned by <span class="function"><a href="function.timezone-open.php" class="function">timezone_open()</a></span></p></dd>
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetimezone.getlocation-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Array containing location information about timezone or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetimezone.getlocation-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>DateTimeZone::getLocation()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$tz </span><span style="color: #007700">= new </span><span style="color: #0000BB">DateTimeZone</span><span style="color: #007700">(</span><span style="color: #DD0000">"Asia/Jakarta"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$tz</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocation</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">timezone_location_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$tz</span><span style="color: #007700">));</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">Array
(
    [country_code] =&gt; ID
    [latitude] =&gt; -6.16667
    [longitude] =&gt; 106.8
    [comments] =&gt; Java, Sumatra
)
Array
(
    [country_code] =&gt; ID
    [latitude] =&gt; -6.16667
    [longitude] =&gt; 106.8
    [comments] =&gt; Java, Sumatra
)</pre>
</div>
    </div>
   </div>
  </p>
  <p class="para">
   The <code class="literal">country_code</code> elements contains the ISO 3166-1
   alpha-2 country code for each entry. The <code class="literal">latitude</code> and
   <code class="literal">longitude</code> elements the coordinates of the named city
   from the time zone identifier, and <code class="literal">comments</code> contain
   (when not <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>) a hint of where in the given country this timezone
   applies. This information is suitable to present to end-users.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-datetimezone.getlocation-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="datetimezone.listidentifiers.php" class="function" rel="rdfs-seeAlso">DateTimeZone::listIdentifiers()</a> - Returns a numerically indexed array containing all defined timezone identifiers</span> to get a full or
   partial list of all supported timezone identifiers</li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>