View Single Post
  #48 (permalink)  
Old 05-08-2008, 02:39 AM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: Operations in PHP

Hi,

The One and Only Ternary Operator

One of the most elegant operators is the ?: (question mark) operator. Its format
is
truth_expr ? expr1 : expr2
The operator evaluates truth_expr and checks whether it is true. If it is,
the value of the expression evaluates to the value of expr1 (expr2 is not evaluated).
If it is false, the value of the expression evaluates to the value of expr2
(expr1 is not evaluated).
__________________
Regards,
Senraj.A
Reply With Quote