Home > Backend Development > PHP Tutorial > cal_days_in_month() function in PHP

cal_days_in_month() function in PHP

WBOY
Release: 2023-09-18 11:32:01
forward
841 people have browsed it

cal_days_in_month() function in PHP

cal_days_in_month() function returns the number of days in a month for the specified year and calendar.

grammar

cal_days_in_month(calendar,month,year);
Copy after login

parameter

  • calendar - The calendar to use.

  • Month - The month to specify.

  • year - The year to specify.

return

cal_days_in_month() function returns the number of days in a month for the specified year and calendar.

Example

The following is an example -

Live Demo

<?php
   $res = cal_days_in_month(CAL_GREGORIAN, 3, 2018);
   echo "$res days";
?>
Copy after login

Output

31 days
Copy after login

The above is the detailed content of cal_days_in_month() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template