PHP Operators: Ternary OperatorTag: operator, Ternary Operator Category: PHP Basicpost: 08 Mar 2008 read: 839 PHP Operators Step By Step Tutorial - Part 7: Ternary operator is the other condition of operator which evaluates the expression of representing moderation model of if... else.... statement. Ternary operator is written down with ?:. Its syntax:
If expr1 is evaluated as true, hence expr2 is done, while if expr2 is evaluated as false, hence expr3 is done. Pay attention to the example of using Ternary operator at script as following:
The result of executing ternaryoperator.php:
|
| | Give Your Opinion | Recommend |
|


