PHP cal_info() Function
In this chapter you will learn:
- Definition for PHP cal_info() Function
- Syntax for PHP cal_info() Function
- Parameter for PHP cal_info() Function
- Return value from PHP cal_info() Function
- Example - Get information about a calendar
Definition
The cal_info() function returns information about a calendar.
Syntax
PHP cal_info() Function has the following syntax.
cal_info(calendar);
Parameter
Optional calendar indicates which calendar to get information.
- 0 = CAL_GREGORIAN
- 1 = CAL_JULIAN
- 2 = CAL_JEWISH
- 3 = CAL_FRENCH
If the calendar parameter is omitted, cal_info() returns info about all calendars.
Return
PHP cal_info() Function returns an array containing calendar elements like:
- calname
- calsymbol
- month
- abbrevmonth
- maxdaysinmonth
Example
Get information about a calendar
<?php
print_r(cal_info(0));
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP cal_to_jd() Function
- Syntax for PHP cal_to_jd() Function
- Parameter for PHP cal_to_jd() Function
- Return value from PHP cal_to_jd() Function
- Example - Convert 20th of June, 2013 (Gregorian calendar) to Julian Day Count
Home » PHP Tutorial » PHP Calendar Functions