Lesson 3 of 8
Operators & Conditions
PHP uses standard arithmetic operators and comparison operators. Use if/elseif/else for branching. The concatenation operator is a dot ., not a plus.
PHP
<?php
$score = 85;
if ($score >= 90) {
echo "A";
} elseif ($score >= 80) {
echo "B";
} else {
echo "C";
}
// String concatenation
$greeting = "Hello, " . $name;
?>