Created
October 24, 2014 02:18
-
-
Save raselahmed7/5e6691a4f21853eca8f8 to your computer and use it in GitHub Desktop.
PHP if else test
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