If Condition in PHP

What is If statement?


If structure is used for conditional execution of code segment


if (expr)

In the above syntax, based on the "expr" the statements are executed

Example :

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

PHP Topics

Ask Questions

Ask Question