As I know, there is no way to change the starting day. So, you can check if the current day is Sunday, and if so, increase the week number with 1:
function getIsoWeeksInYear($year) { $date = new DateTime; $date->setISODate($year, 53); return ($date->format("W") === "53" ? 53 : 52); } function getWeek($date) { $week = date('W',strtotime($date)); $day = date('N',strtotime($date)); $max_weeks = getIsoWeeksInYear(date('Y',strtotime($date))); if($day == 7 && $week != $max_weeks) { return ++$week; } elseif($day == 7) { return 1; } else { return $week; } } echo getWeek('2012-12-30');
source share