当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > cal_info() 函数

PHP
PHP 安全邮件
MySQL 介绍
连接 MySQL
创建 MySQL
MySQL 插入记录
MySQL 选择记录
MySQL Where
MySQL Order By
MySQL 记录更新
MySQL 删除记录
PHP ODBC
XML Expat Parser
XML SimpleXML
PHP 数组参考
PHP Calendar
PHP Date
PHP Directory
PHP Filesystem
PHP FTP
PHP HTTP

PHP 中的 cal_info() 函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 595 ::
收藏到网摘: n/a

Definition and Usage
定义和用法

The cal_info() function returns an array that contains information about a given calendar.
cal_info()函数的作用是:以一个数组的形式返回给定日历的信息。

The array contains the following elements: calname, calsymbol, month, abbrevmonth and maxdaysinmonth.
这个数组包括下面的元素:calname, calsymbol, month, abbrevmonth 和 maxdaysinmonth

Syntax
语法

cal_info(calendar)

Parameter
参数
Description
描述
calendar Optional. Specifies the calendar. The following calendar values can be used:
可选参数。指定需要使用的日历参数:

  • 0 = CAL_GREGORIAN
  • 1 = CAL_JULIAN
  • 2 = CAL_JEWISH
  • 3 = CAL_FRENCH


Tips and Notes
提示

Tip: In PHP 5, if no calendar parameter is specified, information on ALL supported calendars is returned.
提示:在PHP5中,如果日历参数已被指定,那么将返回支持该日历的所有信息。


Example
案例

<?php
$calinfo=cal_info(0);
print_r($calinfo);
?>

The output of the code above will be:
上述代码将输出下面的结果:

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
)

评论 (0) All

登陆 | 还没注册?