Home / CSE MCQs / PHP MCQs :: Discussion

Discussion :: PHP MCQs

  1. If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?
  2. A.
    12
    B.
    1
    C.
    Error
    D.
    5

    View Answer

    Workspace

    Answer : Option D

    Explanation :

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


Be The First To Comment