Question: In the code below, assuming the $hour variable has been defined earlier on in the code, when is the else block executed? if ( $hour
In the code below, assuming the $hour variable has been defined earlier on in the code, when is the else block executed?
if $hour
echo "Good morning";
elseif $hour
echo "Good afternoon";
elseif $hour
echo "Good evening";
else
echo "Good night";
Group of answer choices
It is never executed
Only if none of the conditions in the if statement and elseif statements match
It is always executed
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
