|
|
Tutorials » Php »
|
Topic |
What is If statement?
|
|
Explanation |
|
If structure is used for conditional execution of code segment
Syntax:
if (expr)
{
Statements
}
In the above syntax, based on the "expr" the statements are executed
Example:
<?php
if ($c > $d)
{
echo "c is bigger than d";
}
?>
In the above example, only if the condition "$c>$d" is true, the message "c is bigger than d"
is displayed
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|