You can use the if statement to execute some code only if a specified condition is true.

Syntax:

if (condition)
{
code to be executed if condition is true;
}

Example:
Code:

$p=5;
$q=3;
if ($p > $q)
    echo "p is bigger than q";

Output:

p is bigger than q

eXTReMe Tracker