Skip to content

Instantly share code, notes, and snippets.

@DASPRiD
Created August 15, 2012 10:33
Show Gist options
  • Select an option

  • Save DASPRiD/3358570 to your computer and use it in GitHub Desktop.

Select an option

Save DASPRiD/3358570 to your computer and use it in GitHub Desktop.
<?php
$locale = 'en-US';
$formatter = new IntlDateFormatter($locale, null, null, null, null, 'MMMM');
$date = new DateTime('1970-01-01');
$monthNames = array();
for ($monthNo = 1; $monthNo <= 12; $monthNo++) {
$monthNames[] = $formatter->format($date);
$date->modify('+1 month');
}
var_dump($monthNames);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment