Loop of tuesdays and saturdays

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

Loop of tuesdays and saturdays

Post by xionhack »

Hello. I want to make a loop that will display tuesday, saturday, saturday, saturday, tuesday, saturday, saturday, saturday... etc, but with their exact dates. Let's say this week 1/6/2009, 1/10/2009, 1/10/2009, 1/10/2009, 1/13/2009, 1/17/2009, 1/17/2009, 1/17/2009.... etc, how can i do that?! Thanks
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Loop of tuesdays and saturdays

Post by jaoudestudios »

I dont know what your pattern is for...

Code: Select all

tuesday, saturday, saturday, saturday, tuesday, saturday, saturday, saturday... etc
But you could use something like this...

Code: Select all

$tomorrow  = mktime(0, 0, 0, date("m")  , date("d")+1, date("Y"));
Post Reply