➤ The if statement is used to execute a block of code only if the specified condition evaluates to true. For instance:
$name = "Levani";
if ( $name == "Levani") {
	echo "Condition is True !\n";
}

// "l" A full textual representation of the day of the week
if (date("l") == "Monday") {
	echo "Let's start coding !\n";
}

$x = 10;
$y = 5;
if ($x > $y) {
	echo "10 > 5\n";
}

if ($x < 2) {
	// conditions is false
}
by Levani Makhareishvili
2 years ago
PHP
If statement
1
Pro tip: use ```triple backticks around text``` to write in code fences