payal_suthar payal_suthar - 1 year ago 84
jQuery Question

To display dates continuously in a table column automatically

Friends, how can I display dates as like in calendar in a single column in a table?
And it should be for the entire year continuous.I have searched a lot and have not found anything related.Please help me out.
Thanks in advance.

Answer Source

You can use this code:

    $year = 2016;
    $months = array(1,2,3,4,5,6,7,8,9,10,11,12);

    foreach($months as $month)
        $totalDays = cal_days_in_month(CAL_GREGORIAN, $month, $year);
        for($i=1; $i<= $totalDays; $i++)
            echo date('l',strtotime(date("$year-$month-$i"))).'=>'.date("$year-$month-$i").'<br/>';

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download