$input = "2(feb)";
// parse the input string to extract the month
list(,$month) = sscanf($input,'%d(%[^)]s)');
// Get timestamp for the 1st day of the requested month (using current year)
$startMonth = strtotime('1-'.$month);
// Get the ISO week number for the 1st day of the requested month
$startWeek = date('W',$startMonth);
// Get timestamp for the last day of the requested month (using current year)
$endMonth = strtotime('+1 Month -1 Day',$startMonth);
// Get the ISO week number for the last day of the requested month
$endWeek = date('W',$endMonth);
// get a range of weeks from the start week to the end week
if ($startWeek > $endWeek) {
// start week for january in previous year
$weekRange = range(1,$endWeek);
array_unshift($weekRange,intval($startWeek));
} else {
$weekRange = range($startWeek,$endWeek);
}
var_dump($weekRange);