<!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>Get the locale associated with the object</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.getleastmaximum.html">IntlCalendar::getLeastMaximum</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getmaximum.html">IntlCalendar::getMaximum</a></div> <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="intlcalendar.getlocale" class="refentry"> <div class="refnamediv"> <h1 class="refname">IntlCalendar::getLocale</h1> <p class="verinfo">(PHP 5.5.0, PECL >= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getLocale</span> — <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> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><strong>IntlCalendar::getLocale</strong></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$localeType</code></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> <span class="term"><em><code class="parameter">localeType</code></em></span> <dd> <p class="para"> Whether to fetch the actual locale (the locale from which the calendar data originates, with <strong><code>Locale::ACTUAL_LOCALE</code></strong>) or the valid locale, i.e., the most specific locale supported by ICU relatively to the requested locale – see <strong><code>Locale::VALID_LOCALE</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> </dt> </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>FALSE</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-2607"> <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"><?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">-></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">-></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="cdata"><pre> string(2) "en" string(5) "en_US" </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="intlcalendar.getleastmaximum.html">IntlCalendar::getLeastMaximum</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getmaximum.html">IntlCalendar::getMaximum</a></div> <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>