Multiconditional if Statements : If statement « Statement « PHP






Multiconditional if Statements

 
<?php

    $finished = true;
    $complete = 14;

    if ( ($complete >= 15) || $finished)) {

        echo "get some sleep!<BR>";

    } else {

        echo "no sleep tonight!<BR>";

    }
?>
  
  








Related examples in the same category

1.Executing Multiple Statements with One if
2.An if Statement That Uses else
3.An if Statement That Uses else and elseif
4.An if Statement for string
5.Within an if Else statement
6.In if statement use OR to connect two conditions
7.Use and to connect two statement in if statement
8.A helpful addition to if statements is the elseif statement, which allows you to chain conditions together in a more intelligent way:
9.An if Statement
10.An if Statement That Uses else
11.An if statement That Uses else and else if
12.Basic Use of the if Statement
13.Case Switching
14.Checking multiple conditions
15.Making a decision with if()
16.Multiple statements in an if() code block
17.If-else Statement
18.Using if Statements to Mimic a select Statement
19.Using if statement to print "Youth message" if $age is between 18 and 35
20.Using if to test for multiple values
21.Using else with if()
22.Using elseif()
23.Print the string "Child message" if the $age variable is between 1 and 17