adplus-dvertising
frame-decoration

Question

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

a.

4hello4hello4hello4hello4hello…..infinite

b.

5hello5hello5hello5hello5hello…..infinite

c.

no output

d.

error

Posted under PHP

Answer: (a).4hello4hello4hello4hello4hello…..infinite

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code ?