Skip to content

Instantly share code, notes, and snippets.

@victorknust
Created February 16, 2017 16:13
Show Gist options
  • Save victorknust/fdfc2c04e795cd99447394bfe7489605 to your computer and use it in GitHub Desktop.
Save victorknust/fdfc2c04e795cd99447394bfe7489605 to your computer and use it in GitHub Desktop.
<?php
function getWeekDays() {
$time = strtotime( 'monday this week' );
$days = [];
for($i = 0; $i<7; $i++){
$d = new DateTime();
$d->setTimestamp(strtotime("+$i day",$time));
$days[] = $d->format("Y-m-d");
}
return $days;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment