3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = strtotime(date('2020-06-01 12:00')); for($x = 1; $x<=10; $x++) // increment $x until 10 { $period = $start - ($x * 1209600); // 1209600 is equivalent to 14 days. Multiply by $x $period_end = date('Y-m-d H:i', strtotime(date('Y-m-d H:i', $period). ' + 13 days')); echo date('Y-m-d H:i', $period) . " - " . $period_end ."<br>\n"; }

preferences:
30.45 ms | 405 KiB | 5 Q