Last active
October 8, 2022 12:03
-
-
Save TANVIRFAZLEY/c1a136a965a59ebf9e7747221719a1c3 to your computer and use it in GitHub Desktop.
If else example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Provide an example of an "if – elseif - else" control structure that tests if $day is ‘Monday.’ | |
If so, display ‘Today is Monday.’ Repeat the test of each weekday, displaying ‘Today is (name of the week day), | |
’ otherwise display “It is the weekend.”*/ | |
$dayname = 'Monday'; | |
if($dayname = 'Monday') : | |
echo 'Today is Monday.'; | |
elseif() : | |
echo 'Today is '; | |
else | |
echo 'It is the weekend.'; | |
endif; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment