Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 8934

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!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 &gt;= 5.5.0, PHP 7, 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="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">
   Procedural style
  </p>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>intlcal_get_locale</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$cal</code></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>
<code class="parameter">cal</code></dt>

    <dd>

     <p class="para">
      The IntlCalendar resource.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">localeType</code></dt>

    <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>

   
  </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-3108">
   <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&nbsp;</span><span style="color: #007700">=&nbsp;</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">(),&nbsp;</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 />&nbsp;&nbsp;&nbsp;&nbsp;</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 />&nbsp;&nbsp;&nbsp;&nbsp;</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="cdata"><pre>
string(2) &quot;en&quot;
string(5) &quot;en_US&quot;
</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>