note 45849 deleted from function.date by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 22 Sep 2004 19:32:37 +0000 |
| Subject: | note 45849 deleted from function.date by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77199@lists.php.net to get a copy of this message | ||
Note Submitter: tmorin at cea dot fr
----
This code gives you the dates of a particular week
Example : week 39 (2004)
$arr_date['Mon']='2004-09-20';
$arr_date['Tue']='2004-09-21';
$arr_date['Wed']='2004-09-22';
$arr_date['Thu']='2004-09-23';
$arr_date['Fri']='2004-09-24';
$arr_date['Sat']='2004-09-25';
$arr_date['Sun']='2004-09-26';
//Here is the code
function date_of_week($week)
{
$dec=0;
while($numerosemaine<=$week)
{
$numerosemaine=date( "W",mktime(
0,0,0,"01","01"+$dec,date("Y")) );
if($numerosemaine==$week)
{
$dateEnChiffre=date( "Y-m-d",mktime(
0,0,0,"01","01"+$dec,date("Y")));
$dateEnJourGB=date( "D",mktime(
0,0,0,"01","01"+$dec,date("Y")));
$arr_date[$dateEnJourGB]=$dateEnChiffre;
}
$dec++;
}
return $arr_date;
}