[ create a new paste ] login | about

Link: http://codepad.org/WuBBYeUh    [ raw code | output | fork ]

PHP, pasted on Sep 30:
1
2
3
4
5
6
7
8
9
10
11
<?php
$months = array();
$currentMonth = (int)date('m');

for($x = $currentMonth; $x >=$currentMonth-12; $x--) {
    $months[date('F', mktime(0, 0, 0, $x, 1))] = 0;
}

echo "<pre>";
print_r ($months);
?>


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<pre>Array
(
    [September] => 0
    [August] => 0
    [July] => 0
    [June] => 0
    [May] => 0
    [April] => 0
    [March] => 0
    [February] => 0
    [January] => 0
    [December] => 0
    [November] => 0
    [October] => 0
)


Create a new paste based on this one


Comments: