1. Computing & Technology

Discuss in my forum

Cal_days_in_month () PHP Function

By , About.com Guide

Definition: The Cal_days_in_month () function returns the number of days in a given month, based on the calendar, month, and year that you specify. It is phrased as: Cal_days_in_month (calendar, ##Month, ##year) ;
Also Known As: Calendar days in month
Common Misspellings: Calender days in month
Examples:
 <?php 
 $num = cal_days_in_month(CAL_GREGORIAN, 5, 1979) ; 
 echo "There were $num days in May 1979"; 
 ?> 
This will return: There were 31 days in May 1979

©2012 About.com. All rights reserved.

A part of The New York Times Company.