PHP Ternary operator
Ternary operator conditional operators are used for executing code if a given statement is true or false. Ternary conditional operators are used to reduce space used by if-else statements.
Ternary Operator(?:)
If the condition is true, then the first statement. Else the second statement is the output.
Syntax:
Output: