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

Ajax Insert Records in Database Tutorial in PHP

Displaying Database data using Class, Object, Constructor, Destructor in PHP MySql

SubQuery with EXISTS and NOT EXISTS in PHP