Skip to content

Instantly share code, notes, and snippets.

@styks1987
Last active January 23, 2018 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save styks1987/f777ce5cacd2e588efeb6a8d958c26e2 to your computer and use it in GitHub Desktop.
Save styks1987/f777ce5cacd2e588efeb6a8d958c26e2 to your computer and use it in GitHub Desktop.
<?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