Is there a simpler way to get this result?
<html>
<body>
<?php
$today=date("l");
if ($today=="Monday")
echo "Hurray, it's Monday! <br />";
elseif ($today!="Monday")
echo "Monday <br />";
if ($today=="Tuesday")
echo "Hurray, it's Tuesday! <br />";
elseif ($today!="Tuesday")
echo "Tuesday <br />";
if ($today=="Wednesday")
echo "Hurray, it's Wednesday! <br />";
elseif ($today!="Wednesday")
echo "Wednesday <br />";
if ($today=="Thursday")
echo "Hurray, it's Thursday! <br />";
elseif ($today!="Thursday")
echo "Thursday <br />";
if ($today=="Friday")
echo "Hurray, it's Friday! <br />";
elseif ($today!="Friday")
echo "Friday <br />";
if ($today=="Saturday")
echo "Hurray, it's Saturday! <br />";
elseif ($today!="Saturday")
echo "Saturday <br />";
if ($today=="Sunday")
echo "Hurray, it's Sunday! <br />";
elseif ($today!="Sunday")
echo "Sunday <br />";
?>
</body>
</html>
$today = date(“l”);
print(“Hurray, it’s " . $today . " <br />”);
I’m looking for the same result as the example code. There should be a list of days and when it comes to today it says “Hurray, it’s $today”
Monday
Tuesday
Wednesday
Thursday
Hurray, it’s Friday
Saturday
Sunday
Sorry fore being vague before.
The senior database administrator has seen tremendous progress in your server-side application skills. She notices that you are a fast learner and that your knowledge of PHP is really coming along. She wants you to write a script that cycles through each of the days of the week and outputs that day. Then you will embed in that script a clause that compares each day with the current day. If it is the same day of the week, the script will say “Hurray, it’s (whatever the current day of the week is).” She knows that you need the experience of writing a PHP script that uses both for-next and if-then statements and one that can determine what is the current date. She wants you to make sure to test your scripts in your MAMP or WAMP htdocs directory.
Please complete the requirements for this server-side application using PHP. If you are using sources to provide support or evidence that will enhance your ability to accomplish this assignment, then they must be cited. Please use APA style for all cited sources, including your reference page.
Submit your finished index.php file to your drop box. Your final script should look something like this:
Monday
Tuesday
Hurray, it’s Wednesday!
Thursday
Friday
Saturday
Sunday
<?php
$days = array(
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday'
);
foreach($days as $day){
if(date('l') === $day){
echo "Hurray, it's ", $day, "!\
" ;
continue;
}
echo $day, "\
" ;
}
/*
Monday
Tuesday
Wednesday
Thursday
Friday
Hurray, it's Saturday!
Sunday
*/
?>
I appreciate your reply, this has helped a lot!
Ha, it helped because Anthony did your assignment for you.
I could have turned in what I already had, but I wanted to learn a better way. So, he didn’t do my homework, he showed me how to do it better.
I was hesitant in posting, but the OP did have a working solution which met the assignment requirements already.
My solution, is merely neater/cleaner.
$days = array(
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday'
);
echo implode("<br>",array_replace($days,array((date('N')-1) => "Horray it's ".date('l')."!")));
Do i get extra credit, Professor Sterling? 
PS: Do not submit this to your teacher. They will know you sought help, and you will be unable to explain why it does actually fit all the requirements.