Q. What will be the output of the following PHP code ?
Code:
<?php
$opt = "1";
switch ($opt)
{
case 1:
print "Hello ";
case 2:
print "MCQ";
default:
print "Buddy";
}
?>
β
Correct Answer: (A)
Hello MCQ Buddy
Explanation: As break is not provided it executes all the cases.