Created
October 8, 2018 01:05
-
-
Save liuxd/55657d411975171d030510f220efc6a6 to your computer and use it in GitHub Desktop.
[Calculating days of week given a week number]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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