A

Admin • 833K Points
Coach

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;
}
?>
  • (A) Undefined variable: k
  • (B) First
  • (C) Second
  • (D) Nothing
  • Correct Answer - Option(A)
  • Views: 25
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin

Case cannot be defined by a variable.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.