Skip to content

Instantly share code, notes, and snippets.

@LinzardMac
Created January 12, 2015 21:19
Show Gist options
  • Save LinzardMac/df838278bb07cbeb1d7f to your computer and use it in GitHub Desktop.
Save LinzardMac/df838278bb07cbeb1d7f to your computer and use it in GitHub Desktop.
$date_start = strtotime('first day of next month');
$end_date = strtotime("last day of next month", $date_start);
while ($date_start <= $end_date) :
$weekdates[] = date("Y-m-d", $date_start);
$date_start = strtotime('+1 day', $date_start);
endwhile;
foreach ( $weekdates as $days):
echo 'should be 28 times';
endforeach;
}
***instead of 28 results I am getting 59. When I dump the $weekdates I get from feb1 - mar31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment