Conditional Statements in PHP
<?php
$a =10; // This statement assigns 10 to a
$b = 15; //This statement assigns 15 to b
if( $a > $b) // Checks whether a is greater than b i. e. 10 > 15 here false
{
echo ” a is greater than b”;
} else
echo ” a is less than b”; // This statement will be executed.
?>
____________________________________
Out put- a is less than b
____________________________________
$a =10; // This statement assigns 10 to a
$b = 15; //This statement assigns 15 to b
if( $a > $b) // Checks whether a is greater than b i. e. 10 > 15 here false
{
echo ” a is greater than b”;
} else
echo ” a is less than b”; // This statement will be executed.
?>
____________________________________
Out put- a is less than b
____________________________________