Q. What will be the output of the following PHP code ?
Code:
<?php
$k = 1;
switch(print $k)
{
case 2:
print "Statement1";
break;
case 1:
print "Statement2";
break;
default:
print "Statement3";
}
?>
β
Correct Answer: (D)
1Statement2
Explanation: Print returns 1,thus it gives case 1.