> conditional operator ~ Online tutorial

conditional operator

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";

?
output

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: