Skip to content

Instantly share code, notes, and snippets.

@TANVIRFAZLEY
Last active October 8, 2022 12:03
Show Gist options
  • Save TANVIRFAZLEY/c1a136a965a59ebf9e7747221719a1c3 to your computer and use it in GitHub Desktop.
Save TANVIRFAZLEY/c1a136a965a59ebf9e7747221719a1c3 to your computer and use it in GitHub Desktop.
If else example
<?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