Image Of the Day Code :P

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

#image-of-theday

2 replies · 421 views · started 15 years ago · 1 min read

2 participants
tkreturns Developer · 98 posts #1
<?
$today=date(l); // Find what today is? using date function

if($today==Monday){
echo "Today is Monday";
echo "<BR>";
echo "<img src='images/image1.gif'>";
}

elseif($today==Tuesday){
echo "Today is Tuesday";
echo "<BR>";
echo "<img src='images/image2.gif'>";
}

elseif($today==Wednesday){
echo "Today is Wednesday";
echo "<BR>";
echo "<img src='images/image3.gif'>";
}

elseif($today==Thursday){
echo "Today is Thursday";
echo "<BR>";
echo "<img src='images/image4.gif'>";
}

elseif($today==Friday){
echo "Today is Friday";
echo "<BR>";
echo "<img src='images/image5.gif'>";
}

elseif($today==Saturday){
echo "Today is Saturday";
echo "<BR>";
echo "<img src='images/image6.gif'>";
}

elseif($today==Sunday){
echo "Today is Sunday";
echo "<BR>";
echo "<img src='images/image7.gif'>";
}

?>

Was really bored so code this 😛 Works Fine.! Cheers 😉

ASK FOR HELP

morency Senior · 488 posts #2
$time = time();
$current_day = date('w', $time);
$today=date(l);
echo "Today is $today";
echo "<BR>";
echo "<img src='images/image$current_day.gif'>"; 

http://php.net/manual/en/function.date.php

if you are bored on 50 lines of code .. how you will be on 1000 lines of real code ?!:D

Unamos los corazones,hoy todos somos multicolores!

tkreturns Developer · 98 posts #3

i said i m bored...thtys yy coded it mate..:)

ASK FOR HELP

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close