Home » PHP » PHP Introduction » Question
  1. If $n = 25 what will be returned when (($n == 25) ? 5 : 1) is executed?
    1. 5
    2. 1
    3. 25
    4. Error
    5. None of these
Correct Option: C

?: is known as ternary operator. If condition is true then the part just after the ? is executed else the part after : .



Your comments will be displayed only after manual approval.