What is the difference between if, elseif, and else statements in PHP?
The difference between if, elseif, and else statements in PHP lies in their functionality for conditional branching. The if statement is used to execute a block of code if a specified condition is true. The elseif statement allows you to add additional conditions to be checked if the initial if statement evaluates to false. The else statement is used to execute a block of code if none of the preceding conditions are true.
$score = 85;
if ($score >= 90) {
echo "A";
} elseif ($score >= 80) {
echo "B";
} else {
echo "C";
}