PHP IF Statement

In php if statement is used for compare and check the conditions or arguments (perimeters) . if() is a built in function in php .



executable code


if function is started with small letters “if” ,then braces start ( and close ) , at the end curly braces are started and closed .


It is used for compare and check conditions .



if($a != 10)


echo "Please write the exact number";


In this condition “if” function check the value that variable “$a”  is not equal to “10” . Condition is true ,so the code is executed and function echo the result .

if statement
if statement