Can ternary operators be used for more complex conditional statements in PHP?

Ternary operators can be used for more complex conditional statements in PHP by nesting them within each other. This allows for multiple conditions to be evaluated in a concise and readable way. By using nested ternary operators, you can handle more complex logic without the need for lengthy if-else statements.

// Example of using nested ternary operators for a more complex conditional statement
$score = 85;
$result = $score >= 90 ? "A" : ($score >= 80 ? "B" : ($score >= 70 ? "C" : "D"));
echo "Result: " . $result; // Output: Result: B