A List of Months
I'm trying to create an archive widget with 12 links representing each month. I would like the list to start from last month and run in reverse order. So (as we are currently in March) it would look like this...
Next month (April) March would jump from the bottom up to the top of the list.
Can anyone help?
Here's some code that I've used to create a list of months that might help
<?php foreach(range(1,12) as $month): ?>
<option value="<?php echo $month;?> <?php selectedIf($month,@$_REQUEST['month']);?>"><?php echo date("F",strtotime("1985-$month-01 00:00:00"));?></option>
<?php endforeach ?>
There's also an interesting discussion at http://stackoverflow.com/questions/22735071/display-a-list-of-past-11-months-from-current-date
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php