Codice buttato giù al volo facendo delle prove per cui sicuramente ottimizzabile:
P.S.Codice PHP:function getDateWithoutWeekend($startDate, $endDate) {
$d = strtotime($startDate);
while ($d < strtotime($endDate)) {
if (!(date('N', strtotime(date('Y-m-d', $d))) >= 6)) {
$dates[] = date('Y-m-d', $d);
}
$d += 86400;
}
return $dates;
}
$dates = getDateWithoutWeekend('2013-01-06', '2013-01-20');
foreach ($dates as $date) {
echo $date."
";
}
?>
Le date non sono il mio forte.

Rispondi quotando