TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Creating a 6-Day Cycle Script (http://www.talkphp.com/general/5596-creating-6-day-cycle-script.html)

tactics 10-07-2010 11:53 PM

Creating a 6-Day Cycle Script
 
Hey everyone,

I'm new around here so I hope I don't break any rules by just coming right out with it and asking for help.

Anyway, I was wondering how I could go about using the PHP date function to some how output a number (1 through 6). This seems virtually impossible because every week will be different. So really, it's just about changing a digit each day - not including weekends. Does anybody have incite on how to go about doing this? Or is this an impossible effort?

delayedinsanity 10-09-2010 08:24 PM

Is this what you're trying to do?

php Code:
// Outputs 6 for today (saturday)
echo date( 'w' );

tactics 10-09-2010 10:34 PM

Almost, though I want to output what day it is along with a number (1-6)

For example, something like:

"Today is Saturday, cycle day 4"

The 6 numbers would have to loop Monday through Friday, probably could accomplish this with a start date / end date. Basically the "cycle day" would not be the same for each week. If Friday was cycle day 4, then Monday would be cycle day 5.


All times are GMT. The time now is 08:58 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0