Hello, I would like to change some php to calling on something by day. The one I have only calls on something randomly. Do you know how I can alter this string to accomodate this? Thanks! Jen $banner_no = (rand()%(count($s_con)-1)); Just so you know what the above does, gets a random number which is in the content of my file. for instance if I have 1-some text 2-different text 3-some other text It grabs one of these numbers and the text along with it to display randomly. I would like it to display by day and in order instead.
in order of what? as in 1, 2, 3 as you have it listed? If you wanted to get the current day use date("d",time());
Yes, right now it takes text 1 2 or 3 randomly and displays one of them at a time. I would prefer it to take them as text for DAY 1,2, or 3 and in order instead. If you guys could give me the whole string it would help a lot. For instance drew, should I use this? $banner_no = date("d",time()); and smatt how would I use yours? Thank you very much! Jen-
The only difference between theirs is date("d") gives you the day with leading zeros date("j") gives you the day without leading zeros You do not need that second parameter -- time() -- this is the default value. So you want $banner_no = date("j"); PHP: