Re: newbie needs help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, April 30, 2007 3:37 pm, Ben Clapp wrote:
> I am new to PHP programming and need some help. I have an image that i
> have show up each May for the month with $mymonth = date("m",
> mktime()),
> but i want to set up a date range for it to show up. Ex. 4-13 to 5-13
> each year. How can I do that? Any help would be great.

$now = time();
//leave the year off for 'annual' calculations:
if (mktime(1, 0, 0, 4, 13) <= $time && $time <= mktime(1, 0, 0, 5, 13)){
  //do something to show your May image.
}
else{
  //show the usual image, or nothing, or whatever
}

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux