note 14447 deleted from function.date by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 01:11:53 +0000 |
| Subject: | note 14447 deleted from function.date by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20096@lists.php.net to get a copy of this message | ||
This will return all dates for given days of the week between two dates;
//days to test
$day1="Monday";
$day2="Tuesday";
// begin &end of period :
$mydate="31/07/2001";
$newsplit = explode("/", $mydate);
$dat1=mktime(0,0,0,$newsplit[1],$newsplit[0],$newsplit[2]);
$mydate="29/10/2001";
$newsplit = explode("/", $mydate);
$dat2=mktime(0,0,0,$newsplit[1],$newsplit[0],$newsplit[2]);
print ("<select>");
$datc=$dat1;
while ($datc<=$dat2){
$datw=date("d/m/Y",$datc);
$jour=date ("l", $datc);
if ($day1==$jour || $day2==$jour){
print ("<option value=\"");
print ($datw);
print ("\">");
print ($jour);
print (" " . date("d-m-Y",$datc));
print ("</option>");
}
$datc=$datc + 86400;
}
print ("</select>");