Q. What will be the output of the following PHP code ?
Code:<?php
switch($k)
{
case 2:
print "First";
break;
case k:
print "Second";
break;
}
?>
Dear candidates you will find MCQ questions of PHP here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
<?php
switch($k)
{
case 2:
print "First";
break;
case k:
print "Second";
break;
}
?>
<?php
$n = 128;
switch($n)
{
case "n":
print "Welcome to";
break;
case 128:
print "MCQ";
break;
default:
print "BUDDY";
}
?>
<?php
$p = "1";
$p = 1;
$q = 1;
switch($p)
{
case $p * $q:
print "Hello";
break;
case $p / $q:
print "Hey";
break;
default:
print "Bye";
}
?>
<?php
$opt = "1";
switch($opt)
{
case 1:
break;
print "First Statement";
case 2:
print "Second Statement";
break;
default:
print "Third Statement";
}
?>
<?php
$opt = "1";
switch ($opt)
{
case 1:
print "Hello ";
case 2:
print "MCQ";
default:
print "Buddy";
}
?>