-
What will be the output of the following PHP code ?
<?php
$opt = "1";
switch($opt)
{
case 1:
break;
print "First Statement";
case 2:
print "Second Statement";
break;
default:
print "Third Statement";
}
?>
-
- First Statement
- Second Statement
- Third Statement
- Nothing
- None of these
Correct Option: D
As break is provided before print statement in case 1 it breaks the loop before printing.