<?php
$a = 10;
$b = 5;
// Ternary operator
$max = ($a > $b) ? $a : $b;
echo "The maximum value is: $max <br>";
// Nested ternary operator
$result = ($a > 0) ? (($b > 0) ? "Both numbers are positive" : "Only $a is positive") : "Neither number is positive";
echo "Result: $result <br>";
?>The maximum value is: 10
Result: Both numbers are positive$a` and `$b` and assigned them the values `10` and `5`, respectively. We then use the ternary operator to determine the maximum value of `$a` and `$b`. $a` and `$b` are positive, only `$a` is positive, or neither number is positive. echo` statement.