<?php
// test file for class dayIterator
require_once("day_iterator.php");
$from = MkTime(0, 0, 0, 7, 11, 1986); // I was born in friday
$to = MkTime(0, 0, 0, 7, 20, 1986); // I am still alive :)
$dayIterator = new DayIterator($from, $to);
echo "List of days from ".Date("j.n.Y", $dayIterator->getFrom())." - ".Date("j.n.Y", $dayIterator->getTo());
echo "<br />";
foreach($dayIterator as $day => $date)
{
echo "$day. ".Date("j.n.Y D", $date)."<br />";
}
echo "Total number of days days: ".($dayIterator->getDiffDays() + 1);
?>
|