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

PHP
PHP 介绍
PHP 安装
PHP 语法
PHP 变量
PHP操作符
PHP If...Else
PHP Switch
PHP 数组
PHP 循环
PHP 函数
PHP 表单
PHP $_GET
PHP $_POST
PHP Date
PHP Include
PHP 文件处理
PHP 文件上传
PHP Cookies
PHP Sessions
PHP 发送邮件

PHP 中的 cal_info() 函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 535 ::
收藏到网摘: 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

登陆 | 还没注册?