3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month = 2; $year = 2017; $week = date("W", strtotime($year . "-" . $month ."-01")); Echo date("d/m/Y", strtotime($year . "-" . $month ."-01")) ." - "; $unix = strtotime($year."W".$week ."+1 week"); While(date("m", $unix) == $month){ Echo date("d/m/Y", $unix-86400) . "\n"; Echo date("d/m/Y", $unix) ." - "; $unix = $unix + (86400*7); } Echo date("d/m/Y", strtotime("last day of ".$year . "-" . $month));

preferences:
25.45 ms | 405 KiB | 5 Q