PHP

PHP Menu

PHP

cal_days_in_month() Function - Definition, Syntax, Parameters, Examples

Definition

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

Syntax

cal_days_in_month(calendar, month, year);

Parameters

Parameter Description
calendar Required. Specifies the calendar to use.
month Required. Specifies the month in the selected calendar.
year Required. Specifies the year in the selected calendar.

Example

<?php

$days = cal_days_in_month(CAL_GREGORIAN, 11, 2021);
echo "November 2021 has $days days.";

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods