Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Daily Quote Script Re: PHP Daily Quote Script

#67205
Bob
Member

Exactly what are you trying to accomplish? The way I see it, you’re trying to output a different string of text everyday? Why use such a complex code for that? I made this quickly, haven’t tested it but it should work:



$day = date("l");

switch($day) {
case "Monday":
echo "This is the daily quote for monday!";
break;
case "Tuesday":
echo "This is the daily quote for tuesday!";
break;
case "Wednesday":
echo "This is the daily quote for wednesday!";
break;
case "Thursday":
echo "This is the daily quote for thursday!";
break;
case "Friday":
echo "This is the daily quote for friday!";
break;
case "Saturday":
echo "This is the daily quote for saturday!";
break;
case "Sunday":
echo "This is the daily quote for sunday!";
break;
}

?>

I don’t know if thats what you’re looking for, but if you do its a bit simpler than your code :)

Edit: if one of the mods read this, could you tell me why sometimes the forums show code with code highlighting, and sometimes it doesn’t?