|
Posted by Marcin Dobrucki on 08/23/05 13:27
JAPIO wrote:
> I have two variables which look like:
> $begin = "23-08-05"
> $end = "26-08-05"
>
> Now i want also to know the dates between them.
> 24-08-05
> 25-08-05
>
> How can i do this? Any help would be appreciated.
(hope this is not some course homework...)
list ($day, $month, $year) = split('-', $date);
$t = mktime(0,0,0,$day,$month,$year+2000)
So now you have start/end. Then:
while ($start < $end) {
do_whatever();
$start += 86400;
}
And you can use date() to convert the timestamp back to
human-readable format.
/Marcin
Navigation:
[Reply to this message]
|