Source Code:
(back to article)
<?php $age = 25; // Using the ternary operator to determine if a person is an adult or a child $status = $age >= 18 ? "adult" : "child"; echo "The person is a $status";
Result:
Report an issue