Skip to content

Instantly share code, notes, and snippets.

@liuxd
Created October 8, 2018 01:05
Show Gist options
  • Save liuxd/55657d411975171d030510f220efc6a6 to your computer and use it in GitHub Desktop.
Save liuxd/55657d411975171d030510f220efc6a6 to your computer and use it in GitHub Desktop.
[Calculating days of week given a week number]
<?php
$week_number = 40; // If the number is less than 10, use '0' as the prefix, eg: 03.
$year = 2008;
for($day=1; $day<=7; $day++)
{
echo date('m/d/Y', strtotime($year."W".$week_number.$day))."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment