Last active
January 23, 2018 18:53
-
-
Save styks1987/f777ce5cacd2e588efeb6a8d958c26e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = new \DateTime(); | |
$end = clone($start); | |
$end->add(new \DateInterval('P3M')); | |
$interval = new \DateInterval('P1M'); | |
$months = new \DatePeriod($start, $end, $interval); | |
$options = []; | |
foreach($months as $month){ | |
$options[] = $month->format('F Y'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment