Show something based on date
Posted: Sun Nov 23, 2003 4:01 pm
I have bits of php scatered on my site, and I was wondering how to show an image and text on a certain date. Any help would be good; thanks.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?
$monday=("/htm/images/date/monday.gif");
$tuesday=("/htm/images/date/tuesday.gif");
$wendnesday=("/htm/images/date/wednesday.gif");
$thursday=("/htm/images/date/thursday.gif");
$friday=("/htm/images/date/friday.gif");
$saturday=("/htm/images/date/saturday.gif");
$sunday=("/htm/images/date/sunday.gif");
$zone=("pst");
$img_date=date("w");
$time=date(" h:i a ");
$date=date("F j, Y");
if($img_date=="0")
{
print("<img src="$sunday"> ".$date.$time.$zone);
}
if($img_date=="1")
{
print("<img src="$monday"> ".$date.$time.$zone);
}
if($img_date=="2")
{
print("<img src="$tuesday"> ".$date.$time.$zone);
}
if($img_date=="3")
{
print("<img src="$wednesday"> ".$date.$time.$zone);
}
if($img_date=="4")
{
print("<img src="$thursday"> ".$date.$time.$zone);
}
if($img_date=="5")
{
print("<img src="$friday"> ".$date.$time.$zone);
}
if($img_date=="6")
{
print("<img src="$saturday"> ".$date.$time.$zone);
}
?>