PHP

Topic: Operators

Ternary conditional operator in PHP?

Ternary conditional operator: Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. Syntax: Condition? value if true :value if false; Example: <?php $id = isset($_POST['name']) ? $_POST['name'] : false; ?>

Browse random answers: