Answer Posted / Sudhir Kumar Gupta
In PHP, the 'ternary conditional operator' (also known as the 'conditional expression') is a shorthand way to write an if-else statement. It has the format: (expression1) ? (expression2) : (expression3). For example: <?php $var = 10; $result = ($var > 5) ? 'Greater than 5' : 'Less than or equal to 5'; ?>
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers