<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >cal_info</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="Calendar 日历函数" HREF="ref.calendar.html"><LINK REL="PREVIOUS" TITLE="cal_from_jd" HREF="function.cal-from-jd.html"><LINK REL="NEXT" TITLE="cal_to_jd" HREF="function.cal-to-jd.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.cal-from-jd.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.cal-to-jd.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.cal-info" ></A >cal_info</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN15980" ></A ><P > (PHP 4 >= 4.1.0, PHP 5)</P >cal_info -- Returns information about a particular calendar</DIV ><DIV CLASS="refsect1" ><A NAME="AEN15983" ></A ><H2 >Description</H2 >array <B CLASS="methodname" >cal_info</B > ( [int calendar] )<BR ></BR ><P > <B CLASS="function" >cal_info()</B > returns information on the specified <CODE CLASS="parameter" >calendar</CODE >. </P ><P > Calendar information is returned as an array containing the elements <TT CLASS="literal" >calname</TT >, <TT CLASS="literal" >calsymbol</TT >, <TT CLASS="literal" >month</TT >, <TT CLASS="literal" >abbrevmonth</TT > and <TT CLASS="literal" >maxdaysinmonth</TT >. The names of the different calendars which can be used as <CODE CLASS="parameter" >calendar</CODE > are as follows: <P ></P ><UL ><LI ><P > 0 or <TT CLASS="constant" ><B >CAL_GREGORIAN</B ></TT > - Gregorian Calendar </P ></LI ><LI ><P > 1 or <TT CLASS="constant" ><B >CAL_JULIAN</B ></TT > - Julian Calendar </P ></LI ><LI ><P > 2 or <TT CLASS="constant" ><B >CAL_JEWISH</B ></TT > - Jewish Calendar </P ></LI ><LI ><P > 3 or <TT CLASS="constant" ><B >CAL_FRENCH</B ></TT > - French Revolutionary Calendar </P ></LI ></UL > </P ><P > If no <CODE CLASS="parameter" >calendar</CODE > is specified information on all supported calendars is returned as an array. This functionality is available beginning with PHP 5. </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN16017" ></A ><P ><B >例 1. <B CLASS="function" >cal_info()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br />$info </font><font color="#007700">= </font><font color="#0000BB">cal_info</font><font color="#007700">(</font><font color="#0000BB">0</font><font color="#007700">);<br /></font><font color="#0000BB">print_r</font><font color="#007700">(</font><font color="#0000BB">$info</font><font color="#007700">);<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ><P >上例将输出:</P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="screen" >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 ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.cal-from-jd.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.cal-to-jd.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >cal_from_jd</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.calendar.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >cal_to_jd</TD ></TR ></TABLE ></DIV ></BODY ></HTML >