3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = strtotime('2013-01-01 3:00'); $finishTime = strtotime('2013-03-01 3:00'); $lastMonthDay = strtotime(sprintf('last day of Jan'), $startTime); $dateTime = strtotime(sprintf('%s %s %s', 'Mon', '3:00', 'Jan'), $startTime); for (;$dateTime <= $lastMonthDay; $dateTime = strtotime('+1 week', $dateTime)) { echo date ('d-m-Y H:i', $dateTime) . PHP_EOL; }

preferences:
31.9 ms | 402 KiB | 5 Q