Ternary operator logic is the process of using “(condition) ? (true return value) : (false return value)” statements to shorten your if/else structures.
What Does Ternary Logic Look Like?
[code] /* most basic usage */ $var = 5; $var_is_greater_than_two = ($var > 2 ? true : false); // returns true [/code]
[code] $jk_display_bpos_set = ($jk_display_bpos == 'left') ? 'left' : 'right'; [/code]
Comments are closed.