Speed up development with full-stack environments for every branch.

Learn More

How to calculate the number of days in a month for a given year and calendar

166 Runs 1004 Views 187 Copies
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

<?php

/**
 * PHP Calendar module
 * calculate the number of days in a month for a given year and calendar
 */
echo '<center>';

echo '<div style="background-color:green;padding:10px;color:#fff;font-size:16px;">';
echo '<b>cal_days_in_month(CAL_GREGORIAN, 2, 2010)</b> will return:<br /><b>';
//usage for gregorian calendar
echo cal_days_in_month(CAL_GREGORIAN, 2, 2010);
echo '</b></div>';

echo '<br /><div style="background-color:green;padding:10px;color:#fff;font-size:16px;">';
echo '<b>cal_days_in_month(CAL_JEWISH, 2, 2010)</b> will return:<br /><b>';
//usage for jewish calendar
echo cal_days_in_month(CAL_JEWISH, 2, 2010);
echo '</b></div>';

echo '<br /><div style="background-color:green;padding:10px;color:#fff;font-size:16px;">';
echo '<b>cal_days_in_month(CAL_EASTER_ROMAN, 2, 2010)</b> will return:<br /><b>';
//usage for easter roman  calendar
echo cal_days_in_month(CAL_EASTER_ROMAN, 2, 2010);
echo '</b></div>';

echo '</center>';
?>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).