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

Learn More

How to get info about a calendar with cal_info()

134 Runs 180 Views 27 Copies
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

<?php

/**
 * PHP Calendar module
 * get info about a calendar with cal_info()
 * possible values are:
 * 0 or CAL_GREGORIAN - Gregorian Calendar
   1 or CAL_JULIAN - Julian Calendar
   2 or CAL_JEWISH - Jewish Calendar
   3 or CAL_FRENCH - French Revolutionary Calendar
 */
echo '<center>';

$aCalendars = array(CAL_GREGORIAN, CAL_JULIAN, CAL_JEWISH, CAL_FRENCH);

foreach ($aCalendars as $cal) {
    
    //get info for each calendar type in the array
    $aCalInfo = cal_info($cal);
    echo '<div style="background-color:yellow;padding:10px;color:#000;font-size:16px;width:400px">';
    echo "cal_info( " . $aCalInfo['calsymbol'] . " ) = <pre>";
    print_r($aCalInfo);
    echo "</pre></div><br />";
}

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

Your session has timed out.

Dismiss (the page may not function properly).