If_Else_Statement

 <?php

    $x = 15;

    if($x > 30)
    {
        echo "X is Greater<br>";
    }
    else
    {
        echo "X is Smaller<br>";
    }

    if($x == "15")
    {
        echo "X is Same<br>";
    }
    else
    {
        echo "X is not Same<br>";
    }

    //In case of "===", it will check Value as well as Data Types of Variable
    if($x === "15")
    {
        echo "X is Same in case of Value and Data Types<br>";
    }
    else
    {
        echo "X is Not Same in case of Value and Data Types<br>";
    }

//OUTPUT:
//X is Smaller
// X is Same
// X is Not Same in case of Value and Data Types

?>

Comments

Popular posts from this blog

GROUP BY Clause and HAVING Clause in PHP

Method Overriding in Traits in PHP

Mysqli database Connection and Display Table Data from Database