Home › PHP Tutorial › PHP if...else...elseif
PHP if...else...elseif
Make decisions in code.
Combine conditions with && (and), || (or) and ! (not). Use === to compare value and type.
Example code
<?php
$score = 72;
if ($score >= 90) {
echo "A";
} elseif ($score >= 70) {
echo "B";
} else {
echo "C";
}
?>