3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new DateTime('first Monday of this month'); echo $dt->format('W'); $month = "3"; $year = "2014"; $beg = (int) date('W', strtotime("first monday of $year-$month")); $end = (int) date('W', strtotime("last monday of $year-$month")); for($i = $beg; $i <= $end; ++$i) { print $i . "<br>"; }

preferences:
37.26 ms | 402 KiB | 5 Q