Get Number of Days in Month for Given Year using PHP

cal_days_in_month function

<?php

$year = 2024;
$month = 2;
$numberOfDays = cal_days_in_month(CAL_GREGORIAN, $month, $year);

echo $numberOfDays;

Leave a Comment

Cancel reply

Your email address will not be published.