3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo date('m/Y', strtotime("2017-05-01")); echo '<br/>'; $a = "2007-01-01"; $b = "2008-02-15"; $i = date("Ym", strtotime($a)); while($i <= date("Ym", strtotime($b))){ echo $i."\n"; if(substr($i, 4, 2) == "12") $i = (date("Y", strtotime($i."01")) + 1)."01"; else $i++; }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
05/2017<br/>200701 200702 200703 200704 200705 200706 200707 200708 200709 200710 200711 200712 200801 200802

preferences:
135.87 ms | 404 KiB | 174 Q