Created
November 22, 2013 19:37
-
-
Save emulsion-io/7605579 to your computer and use it in GitHub Desktop.
Liste toutes les dates ( debut et fin ) en fonction de leur numero de semaine ( attention si la semaine 1 ne commence pas un lundi )
This file contains 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 | |
for ($w=1; $w < 53; $w++) { | |
for($i = 1; $i <= 365; $i++) { | |
$week = date("W", mktime(0, 0, 0, 1, $i, 2014)); | |
if($week == $w) { | |
$debut = date("Y-m-d", mktime(0, 0, 0, 1, $i, 2014)); | |
$fin = date("Y-m-d", mktime(0, 0, 0, 1, $i+6, 2014)); | |
echo '<a href="/api/index.php?date_du='.$debut.'&date_au='.$fin.'" target="_blank">Semaine '.$w.'</a><br />'; | |
break; | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment