0

i want to display months in descending order starting from the current month. Example:

The current month is October.
So .. i want to display all 12 months like this..
october
september
august
july
june
may
april
march
february
january
december
november

please note ...it should be dynamic.. in the month of november, it should start with november month

This might be helpful... the below code can print days in ascending order??

        for ($i = 0; $i < 30; $i++)
{
    $timestamp = time();
    $tm = 86400 * $i; // 60 * 60 * 24 = 86400 = 1 day in seconds
    $tm = $timestamp - $tm;

   echo  $the_date = date("Y-m-d", $tm);
   echo "<br/>";
}

0 Answers0