Created
February 26, 2013 23:31
-
-
Save listenrightmeow/5043378 to your computer and use it in GitHub Desktop.
Build array of dates from defined date object
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
$cols = array(); | |
$date = new DateTime(date('Y-m-d', strtotime('-1 week'))); | |
for ($i = 0; $i < 7; $i++) { | |
$cols[$date->format('l')] = array( | |
'label' => $date->format('Y-m-d') | |
); | |
$date->modify('+1 day'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment