Using Comparison Operators in if Statements : Comparison Operators « Operator « PHP






Using Comparison Operators in if Statements

 
<?php

    $p = 14;

    if ($p < 15) {

        echo "Sorry! <BR>";

    } else {

        echo "Congratulations";

    }
?>
  
  








Related examples in the same category

1.Comparison Operators
2.Comparing numbers and strings
3.Loose Comparison Operators
4.The Ternary Operator
5.The equality operator
6.These values are compared using dictionary order
7.These values are compared using numeric order
8.Equality Operators summary table
9.Equality Operators in action