This is a ternary operator:
The expression (expr1) ? (expr2) : (expr3)
evaluates to expr2
if expr1
evaluates to TRUE
, and expr3
if expr1
evaluates to FALSE
.
More Related Contents:
- PHP syntax question: What does the question mark and colon mean? [duplicate]
- Where can I read about conditionals done with “?” and “:” (colon)? [duplicate]
- Parse error: syntax error, unexpected ‘;’ [closed]
- Stacking Multiple Ternary Operators in PHP
- PHP syntax for dereferencing function result
- What are the PHP operators “?” and “:” called and what do they do?
- What does ‘
- How to write a PHP ternary operator [duplicate]
- Why is PHP printing my number in scientific notation, when I specified it as .000021?
- Difference between if () { } and if () : endif;
- PHP curly brace syntax for member variable
- Initializing PHP class property declarations with simple expressions yields syntax error
- PHP Difference between array() and []
- Ternary operator and string concatenation quirk?
- Shorthand for arrays: is there a literal syntax like {} or []?
- Ternary operator left associativity [duplicate]
- How to concatenate multiple ternary operator in PHP? [duplicate]
- Understanding nested PHP ternary operator [duplicate]
- C#’s null coalescing operator (??) in PHP
- What is “:” in PHP? [closed]
- What does the b in front of string literals do?
- PHP syntax for dereferencing function result
- Why PHP variables start with a $ sign symbol?
- PHP multiple ternary operator not working as expected
- Difference between
- How can I add a condition inside a php array?
- What is the difference between ‘ and ” in PHP? [duplicate]
- What is the name for the “
- What is the use of
- Weak typing in PHP: why use isset at all?