- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$year = "2017";
$month = "10";
$day = "01";
$first_date = $year."-".$month."-".$day;
$last_date = date("Y-m-t",strtotime($first_date));
$first_week = date("W",strtotime($first_date));
$last_week = date("W",strtotime($last_date));
for($i=$first_week;$i<=$last_week;$i++)
{
echo "Week #".$i.", ";
}