What will be the output of the following PHP code ?
<?php
$a = "2";
switch ($a)
{
case 1:
print "hi";
case 2:
print "hello";
break;
default:
print "hi1";
}
?>
<?php
$a = "2";
switch ($a)
{
case 1:
print "hi";
case 2:
print "hello";
break;
default:
print "hi1";
}
?>A. hihellohi1
B. hello
C. hihi1
D. hi1
Answer: Option B

Join The Discussion