Skip to content

Instantly share code, notes, and snippets.

@raselahmed7
Created October 24, 2014 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raselahmed7/5e6691a4f21853eca8f8 to your computer and use it in GitHub Desktop.
Save raselahmed7/5e6691a4f21853eca8f8 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