<!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 >= 4.1.0, PHP 5)</p><p class="refpurpose"><span class="refname">cal_info</span> — <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 "all calendars" 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"><?php<br />$info </span><span style="color: #007700">= </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">?></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] => Array ( [1] => January [2] => February [3] => March [4] => April [5] => May [6] => June [7] => July [8] => August [9] => September [10] => October [11] => November [12] => December ) [abbrevmonths] => Array ( [1] => Jan [2] => Feb [3] => Mar [4] => Apr [5] => May [6] => Jun [7] => Jul [8] => Aug [9] => Sep [10] => Oct [11] => Nov [12] => Dec ) [maxdaysinmonth] => 31 [calname] => Gregorian [calsymbol] => 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>