<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.intlcalendar.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'intlcalendar.getlocale.php',
    1 => 'IntlCalendar::getLocale',
    2 => 'Get the locale associated with the object',
  ),
  'up' => 
  array (
    0 => 'class.intlcalendar.php',
    1 => 'IntlCalendar',
  ),
  'prev' => 
  array (
    0 => 'intlcalendar.getleastmaximum.php',
    1 => 'IntlCalendar::getLeastMaximum',
  ),
  'next' => 
  array (
    0 => 'intlcalendar.getmaximum.php',
    1 => 'IntlCalendar::getMaximum',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/intl/intlcalendar/getlocale.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="intlcalendar.getlocale" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::getLocale</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getLocale</span> &mdash; <span class="dc-title">Get the locale associated with the object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.getlocale-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>IntlCalendar::getLocale</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$type</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</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"><strong>intlcal_get_locale</strong></span>(<span class="methodparam"><span class="type"><a href="class.intlcalendar.php" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$calendar</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$type</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</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 the locale used by this calendar object.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.getlocale-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">calendar</code></dt>
    <dd>
     <p class="para">An <span class="classname"><a href="class.intlcalendar.php" class="classname">IntlCalendar</a></span> instance.</p>
    </dd>
   
   
    <dt><code class="parameter">type</code></dt>
    <dd>
     <p class="para">
      Whether to fetch the actual locale (the locale from which the calendar
      data originates, with <strong><code><a href="class.locale.php#locale.constants.actual-locale">Locale::ACTUAL_LOCALE</a></code></strong>) or the
      valid locale, i.e., the most specific locale supported by ICU relatively
      to the requested locale – see <strong><code><a href="class.locale.php#locale.constants.valid-locale">Locale::VALID_LOCALE</a></code></strong>.
      From the most general to the most specific, the locales are ordered in
      this fashion – actual locale, valid locale, requested locale.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.getlocale-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   A locale string or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-intlcalendar.getlocale-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>IntlCalendar::getLocale()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$cal </span><span style="color: #007700">= </span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlTimeZone</span><span style="color: #007700">::</span><span style="color: #0000BB">getGMT</span><span style="color: #007700">(), </span><span style="color: #DD0000">'en_US_CALIFORNIA'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(<br />    </span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocale</span><span style="color: #007700">(</span><span style="color: #0000BB">Locale</span><span style="color: #007700">::</span><span style="color: #0000BB">ACTUAL_LOCALE</span><span style="color: #007700">),<br />    </span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocale</span><span style="color: #007700">(</span><span style="color: #0000BB">Locale</span><span style="color: #007700">::</span><span style="color: #0000BB">VALID_LOCALE</span><span style="color: #007700">)<br />);</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(2) &quot;en&quot;
string(5) &quot;en_US&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


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