Reply to Re: how do you get a list of all dates between two dates more than a day apart?

Your name:

Reply:


Posted by Al on 01/21/06 20:23

Ken Robinson wrote:
> Try this simple function:
>
> <?php
> $date_array = date_range('10/20/2005','01/31/2006');
> $dates = "'" . implode("','",$date_array) . "'";
> echo $dates . "<br />\n";
>
> function date_range($sd,$ed)
> {
> $tmp = array()
> $sdu = strtotime($sd);
> $edu = strtotime($ed);
> while ($sdu <= $edu) {
> $tmp[] = date('Y-m-d',$sdu);
> $sdu = strtotime('+1 day',$sdu);
> }
> return ($tmp);
> }
> ?>
>
> Ken

That was my simple function :) Mine just got out of control with
comments and stuff...

As for the sql BETWEEN operator, I was thinking that too... but I'm not
100% on sql so I was just kinda thinking "surely it has a between
operator".

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация