Examveda
Examveda

If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?

A. 12

B. 1

C. Error

D. 5

Answer: Option D

Solution(By Examveda Team)

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

This Question Belongs to PHP >> Basic PHP

Join The Discussion

Related Questions on Basic PHP