if Statement in php
if Statement in php
An if statement is a way of controlling the execution of a statement that follows it (that
is, a single statement or a block of code inside braces). The if statement evaluates an
expression between parentheses. If this expression results in a true value, the statement
is executed. Otherwise, the statement is skipped entirely. This enables scripts to make
decisions based on any number of factors.
if ( expression ) {
// code to execute if the expression evaluates to true
}
<?php
$status = 1;
if ( $status == 1 ) {
echo “I am here, How are you”;
}
?>