<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns location information for a timezone</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="datetimezone.construct.html">DateTimeZone::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="datetimezone.getname.html">DateTimeZone::getName</a></div> <div class="up"><a href="class.datetimezone.html">DateTimeZone</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><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 >= 5.3.0)</p><p class="refpurpose"><span class="refname">DateTimeZone::getLocation</span> -- <span class="refname">timezone_location_get</span> — <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="type">array</span> <span class="methodname"><strong>DateTimeZone::getLocation</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment">Procedural style</p> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><a href="function.timezone-location-get.html" class="methodname">timezone_location_get</a></span> ( <span class="methodparam"><span class="type"><a href="class.datetimezone.html" class="type DateTimeZone">DateTimeZone</a></span> <code class="parameter">$object</code></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> <span class="term"><em><code class="parameter"> object</code></em></span><dd> <p class="para">Procedural style only: A <a href="class.datetimezone.html" class="classname">DateTimeZone</a> object returned by <span class="function"><a href="function.timezone-open.html" class="function">timezone_open()</a></span></p></dd> </dt> </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. </p> </div> <div class="refsect1 examples" id="refsect1-datetimezone.getlocation-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-2280"> <p><strong>Example #1 <span class="function"><strong>DateTimeZone::getLocation()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?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">"Europe/Prague"</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">-></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">));<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Array ( [country_code] => CZ [latitude] => 50.08333 [longitude] => 14.43333 [comments] => ) Array ( [country_code] => CZ [latitude] => 50.08333 [longitude] => 14.43333 [comments] => ) </pre></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="datetimezone.construct.html">DateTimeZone::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="datetimezone.getname.html">DateTimeZone::getName</a></div> <div class="up"><a href="class.datetimezone.html">DateTimeZone</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>