1. Home
  2. Computing & Technology
  3. PHP / MySQL

Cal_days_in_month () PHP Function

By Angela Bradley, About.com

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

Explore PHP / MySQL

More from About.com

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. Calendar Days In Month - PHP Days in Month- Cal_days_in_month function PHP

©2008 About.com, a part of The New York Times Company.

All rights reserved.