Organizational Research By

Surprising Reserch Topic

how to Ternary conditional operator in PHP?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
21 views



Related Hot Questions

1 Answer

0 votes

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:

$id = isset($_POST['name']) ?  $_POST['name'] : false;
?>

answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...