Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 2257

php-manual-en-5.5.7-1.mga4.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>Returns information about a particular calendar</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.cal-from-jd.html">cal_from_jd</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cal-to-jd.html">cal_to_jd</a></div>
 <div class="up"><a href="ref.calendar.html">Calendar Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.cal-info" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cal_info</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5)</p><p class="refpurpose"><span class="refname">cal_info</span> &mdash; <span class="dc-title">Returns information about a particular calendar</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cal-info-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>cal_info</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$calendar</code><span class="initializer"> = -1</span></span>
  ] )</div>

  <p class="para rdfs-comment">
    <span class="function"><strong>cal_info()</strong></span> returns information on the
   specified <em><code class="parameter">calendar</code></em>.
  </p>
  <p class="para">
   Calendar information is returned as an array containing the
   elements <em>calname</em>, <em>calsymbol</em>,
   <em>month</em>, <em>abbrevmonth</em> and
   <em>maxdaysinmonth</em>. The names of the different calendars 
   which can be used as <em><code class="parameter">calendar</code></em> are as follows:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      0 or <strong><code>CAL_GREGORIAN</code></strong> - Gregorian Calendar
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      1 or <strong><code>CAL_JULIAN</code></strong> - Julian Calendar
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      2 or <strong><code>CAL_JEWISH</code></strong> - Jewish Calendar
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      3 or <strong><code>CAL_FRENCH</code></strong> - French Revolutionary Calendar
     </span>
    </li>
   </ul>
  </p>
  <p class="para">
   If no <em><code class="parameter">calendar</code></em> is specified information on all
   supported calendars is returned as an array. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cal-info-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">calendar</code></em></span>
     <dd>

      <p class="para">
       Calendar to return information for. If no calendar is specified
       information about all calendars is returned.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.cal-info-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.cal-info-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.0.0</td>
       <td>
        The <em><code class="parameter">calendar</code></em> parameter becomes optional
        and defaults to &quot;all calendars&quot; if omitted.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.cal-info-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-2245">
    <p><strong>Example #1  <span class="function"><strong>cal_info()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$info&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cal_info</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</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
(
    [months] =&gt; Array
        (
            [1] =&gt; January
            [2] =&gt; February
            [3] =&gt; March
            [4] =&gt; April
            [5] =&gt; May
            [6] =&gt; June
            [7] =&gt; July
            [8] =&gt; August
            [9] =&gt; September
            [10] =&gt; October
            [11] =&gt; November
            [12] =&gt; December
        )

    [abbrevmonths] =&gt; Array
        (
            [1] =&gt; Jan
            [2] =&gt; Feb
            [3] =&gt; Mar
            [4] =&gt; Apr
            [5] =&gt; May
            [6] =&gt; Jun
            [7] =&gt; Jul
            [8] =&gt; Aug
            [9] =&gt; Sep
            [10] =&gt; Oct
            [11] =&gt; Nov
            [12] =&gt; Dec
        )

    [maxdaysinmonth] =&gt; 31
    [calname] =&gt; Gregorian
    [calsymbol] =&gt; CAL_GREGORIAN
)
</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="function.cal-from-jd.html">cal_from_jd</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cal-to-jd.html">cal_to_jd</a></div>
 <div class="up"><a href="ref.calendar.html">Calendar Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>