Skip to content

Instantly share code, notes, and snippets.

@mjinayan80
Created October 25, 2017 07:33
Show Gist options
  • Select an option

  • Save mjinayan80/4fc0792b2a571f38f005d58c9766d730 to your computer and use it in GitHub Desktop.

Select an option

Save mjinayan80/4fc0792b2a571f38f005d58c9766d730 to your computer and use it in GitHub Desktop.
PHP if else test
<?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