This kind of simple if/then statement is very common in every day life.It
also appears in programming quite very often.
The if statement is very important in PHP.
An if statement is a way of controlling the execution of a statement that follows it.
The if statement evaluates an expression and if the results in a true, the statement is executed. Otherwise, the statement is skipped entirely.
This enables scripts to make decisions based on any number of factors.
Let's look at the details of this example.
See what happens when a PHP if statement is not true,(false)
Here the variable contained the value "Sam", which is not equal to "Joe".
The if statement evaluated to false, so the code segment of the if statement was not executed.
When used properly, the if statement is very powerful.
Note
For more detail please see
Php Manual at http://www.php.net