This is a discussion on Dates within the PHP General forums, part of the PHP Programming Forums category; I have extracted 2 dates using MySQL, StartDate and EndDate and also done a DATEDIFF to find out how many ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have extracted 2 dates using MySQL, StartDate and EndDate and also
done a DATEDIFF to find out how many days between the two. What I am wanting to do in PHP is Starting from the StartDate loop around to a count of the DATEDIFF and add a checkbox with the day name next to it. Just can't seem to work out the code. A psuedo code example would be: Loop until x = DATEDIFF $DayName = format(StartDate, DATEADD(StartDate, x), '%D') echo "<input type='checkbox' /> $DayName" End |
|
|||
|
cybergoth_0@yahoo.co.uk wrote:
> I have extracted 2 dates using MySQL, StartDate and EndDate and also > done a DATEDIFF to find out how many days between the two. > > What I am wanting to do in PHP is Starting from the StartDate loop > around to a count of the DATEDIFF and add a checkbox with the day name > next to it. Just can't seem to work out the code. > > A psuedo code example would be: > > Loop until x = DATEDIFF > $DayName = format(StartDate, DATEADD(StartDate, x), '%D') > echo "<input type='checkbox' /> $DayName" > End > I think tou are looking for this function: strftime http://www.php.net/manual/en/function.strftime.php Jonathan -- A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? |