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; ?>
PHP
Topic: Operators
Ternary conditional operator in PHP?
Browse random answers:
Ternary conditional operator in PHP?
what is the output here? < ?php var_dump(0 == "a"); ?> a) false b) true c) error d) declaration error
< ?php $x = 3 - 5 % 3; echo $x; ?> A. 2 B. 1 C. Null D. True E. 3
what the difference between the ‘BITWISE AND’ operator and the ‘LOGICAL AND’ operator?
What are the two main string operators?
What does the array operator ‘===’ means?
What is the differences between $a != $b and $a !== $b?
What is the answer of following code echo 1< 2 and echo 1 >2 ? Output of the given code are given below: echo 1<2output: 1echo 1>2
What is the value of $a? <?php $a = in_array('01', array('1')) == var_dump('01' == 1); ?>
What is the best all-purpose way of comparing two strings?