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

PHP
WINDOWS下安装MySQL
PHP 制作 网站/服务器 监视脚本
用PHP和CSS制作活动按钮
PHP 单件模式
PHP MVC模式,类封装以及HACK
PHP 中使用正则表达式
PHP 防止 SQL 注入攻击
PHP 跨站点脚本攻击
PHP 防止用户操纵 GET 变量
PHP 防止远程表单提交

PHP 中的 cal_info() 函数


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

登陆 | 还没注册?