ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?php
$i = 0
while ($i++)
{
    print $i;
}
print $i;
?>

Answer & Solution
Correct Answer: Option D
As it is a post increment, it checks and then does not enter the loop, thus prints only 1.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.