PHP | cal_info( ) Function Last Updated : 29 Sep, 2021 Comments Improve Suggest changes Like Article Like Report The cal_info() function in PHP is an inbuilt function that is used to return information about a specified calendar. The cal_info() function returns an array that contains the calname, month, abbrevmonth and maxdaysinmonth, and calsymbol. It takes the calendar as a parameter and returns the information respective to the specified calendar. Syntax: cal_info($calendar) Parameters: The cal_info() function in PHP accepts only one parameter $calendar. This parameter specifies a number that indicates the calendar you want to know about. Below is the list of valid numbers which can be used as value for this parameter. 0 = CAL_GREGORIAN1 = CAL_JULIAN2 = CAL_JEWISH3 = CAL_FRENCH Return Value: It returns information about a specified calendar. Errors And Exceptions: If no calendar is specified in the parameters, the cal_info() function returns information about all the calendars.To specify a calendar as a parameter for the cal_info() function, one needs to mention its respective numerical value instead of the calendar name such as "0" for Gregorian calendar. Below programs illustrate the cal_info() function. Program 1: PHP <?php // displaying information // regarding gregorian calendar print_r (cal_info(0)); ?> Output: 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 ) Program 2: PHP <?php // displaying information // regarding jewish calendar print_r (cal_info(2)); ?> Output: Array ( [months] => Array ( [1] => Tishri [2] => Heshvan [3] => Kislev [4] => Tevet [5] => Shevat [6] => Adar I [7] => Adar II [8] => Nisan [9] => Iyyar [10] => Sivan [11] => Tammuz [12] => Av [13] => Elul ) [abbrevmonths] => Array ( [1] => Tishri [2] => Heshvan [3] => Kislev [4] => Tevet [5] => Shevat [6] => Adar I [7] => Adar II [8] => Nisan [9] => Iyyar [10] => Sivan [11] => Tammuz [12] => Av [13] => Elul ) [maxdaysinmonth] => 30 [calname] => Jewish [calsymbol] => CAL_JEWISH ) Reference: http://php.net/manual/en/function.cal-info.php Comment More infoAdvertise with us Next Article PHP | cal_to_jd() Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-date-time Practice Tags : Misc Similar Reads PHP | cal_days_in_month( ) Function The cal_days_in_month( ) function in PHP is an inbuilt function which is used to return the number of days in a month for a specific year and according to a specific calendar such as Gregorian calendar, French calendar, Jewish calendar etc. The cal_days_in_month() function takes three parameters whi 2 min read PHP | cal_from_jd() Function The cal_from_jd() function is an inbuilt function in PHP that is used to convert a Julian Day Count into a supported calendar such as the Gregorian calendar, French Calendar, Jewish calendar, etc. This function accepts two parameters $jd and $calendar and returns the array containing calendar inform 2 min read PHP | cal_info( ) Function The cal_info() function in PHP is an inbuilt function that is used to return information about a specified calendar. The cal_info() function returns an array that contains the calname, month, abbrevmonth and maxdaysinmonth, and calsymbol. It takes the calendar as a parameter and returns the informat 2 min read PHP | cal_to_jd() Function The cal_to_jd() function is an inbuilt function in PHP which is used to converts a specified date into Julian Day Count. The cal_to_jd() function calculates the Julian day count for a date in the specified calendar. This function supports CAL_GREGORIAN, CAL_JULIAN, CAL_JEWISH and CAL_FRENCH calendar 2 min read PHP | easter_date() Function The easter_date() function is a built-in function in PHP which returns the Easter date in the year passed as an argument. The current year is taken as default year when no arguments are passed as parameter. Syntax: easter_date( $year ) Parameter: The function accepts one optional parameter $year whi 2 min read PHP | easter_days() Function The easter_days() Function is a built-in function in PHP which returns the number of days after March 21, that the Easter Day is in the given year. When no year is given, the current year is taken as the default value. Syntax: easter_days( $year, $method ) Parameters: The function accepts two option 2 min read PHP | frenchtojd() Function The frenchtojd() function is a built-in function which converts a French date to a Julian Day Count. The function accepts three parameters in format $month / $day / $year, which represents the date in French republican calendar and converts it to a Julian Day count. Syntax: frenchtojd( $month, $day, 2 min read PHP | gregoriantojd() Function The gregoriantojd() function is a built-in function which converts a Gregorian date to a Julian Day Count. The function accepts three parameters in format $month / $day / $year, which represents the date in Gregorian calendar and converts it to a Julian Day count. Syntax: gregoriantojd( $month, $day 2 min read PHP | jddayofweek() Function The jddayofweek() function is a built-in function in PHP which returns the given day of the week of a Julian integer passed in the argument. The return value is of three types depending on the mode passed in the function. It returns three types of values which represents the day of the week. If the 3 min read PHP | jdmonthname() Function The jdmonthname() function is a built-in function in PHP which returns the month name of a Julian day number passed as the argument. The return value is of six types depending on the mode passed in the function which is explained briefly below in the parameter part. Syntax: jdmonthname($jd, $mode) P 4 min read Like