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;
}
?>
β
Correct Answer: (A)
Undefined variable: k
Explanation: Case cannot be defined by a variable.