?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$i = 0
while ($i++)
{
print $i;
}
print $i;
?>
<?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.
Join the Discussion
Login to post a comment or share your explanation.
Login