The ? operator is equivalent to an if statement.it os called a terary operator because it takes three parameters an expression :an expression that is evaluated to be TRUE and FALSE an expression that is evaluates if it tree and expression evaluated if the first is FALSE
Syntax(expr1)?(expr2):(expr3);
Example
?php $n=6; $b=7; $val=($num 1>b)?$n:$b; echo "The greatest value is $val"; ? |
0 comments:
Post a Comment