ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?php
$b = 1;
switch(print $b)
{
case 2:
    print "hello";
    break;
case 1:
    print "hi";
    break;
default:
    print "hi1";
}
?>

Answer & Solution
Correct Answer: Option B
Print returns 1,thus it gives case 1.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.